File Detail page in community display Follow button, follower, and file version.
We don't want to show this to portal users.
I checked Feed Tracking but I can't find how to hide follow button.
What should I do?
5 Answers
Its not possible to hide Follow button in communties when you enable chatter feed. Please upvote below idea.
https://success.salesforce.com/ideaView?id=0873A0000003VYDQA2
At present, There is no feature provided by Salesforce to hide/unhide the follow button in communities if chatter feed is enabled (as mentioned in earlier answers). However you can make use of CSS override in the community.
Go to Community Builder -> Theme Editor Setting -> Edit CSS -> Put below code
div[class="slds-page-header slds-page-header_record-home forceHighlightsStencilDesktop forceRecordLayout"] div[role="group"] button:first-of-type {display: none;}
Best code (from Brian Schwartz on Idea Exchange):
.slds-button.slds-button--neutral.not-selected.slds-not-selected {
display:none
}
.slds-button.slds-button--neutral.is-selected.slds-is-selected {
display:none
}
-
Thia is a perfect fix, those wondering : Go to Community Builder -> Theme Setting (top dropdown chevron)-> Edit CSS -> Put below code– SidCommented May 3, 2022 at 18:55
Below code works for me. Specifically targets FOLLOW button on that object regardless if it is already selected or not. Hope it helps!
div[data-target-selection-name="sfdc:StandardButton.Account.Follow"] {display:none !important;}
It seems that the Custom CSS snippet indicated by Awinash Kr Sharma is not working in some instances because Salesforce has modified the classes of the container element of the 'Follow' button.
div[class="slds-page-header slds-page-header_record-home forceHighlightsStencilDesktop forceRecordLayout"] div[role="group"] button:first-of-type {display: none;}
I have applied a new Custom CSS that works both in the instances where the previous Custom CSS no longer works and in the instances where it still works.
div[data-target-selection-name*='.Follow'] {display: none;}
The most important part of the above snippet is the asterisk character *
, which indicates that the attribute value must contain the string that appears after the equal character =
.
IMPORTANT
It should be noted that by applying this snippet will hide the button in the 'Record Banner' component of all objects.