Can I disable share function?

General Discussion
  • Share content in the forum to social network websites like Facebook, Twitter is good idea, but is it possible to disable the Share function, or just disable in specific Categories?

  • Admin > General Settings

  • thanks
    can I set share function on/off different categories?

    ex: "Announcements" close share "General Discussion" open share....

  • @Paul.Li-李隱唐 Not by default, but it would be possible using CSS just to hide the ones you don't want. It will also require a small template change,

    This is for the topic page, look here after share-dropdown, add a space, then category-{category.cid}

    This will give you a class to grab hold of when doing the CSS change.

    You'll then see after share-dropdown will be (in the case of this topic) a class called category-2 (because the category we're in has a cid of 2), you can then do soemthing like this in your CSS...

    .category-2 ul.dropdown-menu li a.facebook-share, a.twitter-share,, .dropdown-header {
    display: none !important;

    Which will give you


    You'd then do exactly the same thing for the category pages, except your CSS would be slightly different.

    .category-2.inline-block button.btn.btn-default.dropdown-toggle {
    display: none !important;

    And the category-{category.cid} would go here

    the -2 will change depending on what category you are in, so you would need to copy the above CSS for each category, adjusting the CID in the first class as required. I did look to see if their was a CSS selector that would allow you to specify .category-[1,3,4,6,8] but I don't believe their is. @trevor might know.

    Hope this helps. 👍

    Also note, just because it's hidden, doesn't mean it wouldn't be possible for someone to hard code the share URL. However at that point it would be far easier for someone to just copy the URL and paste it into Facebook themself.

    There's probably other ways of doing this, as this way is a bit hacky.

  • We should probably add the category name or id as a class to category.tpl so it is easier to do category specific css changes like this.

  • @a_5mith

    thanks, I will trying it

Suggested Topics