Can I disable share function?
-
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?
-
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, thencategory-{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 calledcategory-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, a.google-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 herethe -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.