Friday 13 November 2015

CSS to hide Social Controls

CSS to hide Social Controls

The Problem

The SharePoint Farm is not setup to serve Social content and either the links do not work or are simply not desired but removal permanently is not desired as there may be a time and place for these components in the future.

The Approach

Use CSS to hide the elements without blowing up the page layout. Maintain the possibility to integrate in isolated sites or for isolated users. Use the custom CSS file in site Assets (or where ever it has been added to the sites in general)

The Result

.ms-core-suiteLinkList {display: none} 
// hides all three elements

#ctl00_ctl55_ShellNewsfeed {display:none}
// hides the Newsfeed link
#ctl00_ctl55_ShellDocuments {display:none}
// hides the OneDrive link
#ctl00_ctl55_ShellSites {display:none}
// hides the Sites link

#site_follow_button {display:none}
// hides the follow button and star icon

Going Forward

Could use a JavaScript routine to check group membership of the current user and if in a specific group (or groups) to toggle element visibility.

No comments:

Post a Comment