Hide Site Contents from the Left Navigation in SharePoint Server 2013 Community sites
Now that SharePoint Server 2013 RTM has been released, I am seeing more and more questions from clients about what has changed in 2013, or specific questions about their implementation of 2013 so far. One recent request was to hide the Site Contents link from the left navigation. Now, your probably thinking to yourself, that's easy, just click that "Edit Links" button in the left navigation and then click the X to delete that link. To be honest, you wouldn't be wrong! However, what about the site templates that do not give you this option, for example a Community site. If you look at one of these sites, SharePoint 2013 has limited a lot of access. By this I mean they hide a lot, and one of the things that is hidden or not included is the Edit Links button in the left navigation. So lets get into this SharePoint Help topic:
To get Site Contents to not show in the left navigation, you have to make the change through CSS or the master page. I have done it through CSS to make things easier, since you do not have to really go into SharePoint Designer or touch the master page. Here is what I have done:
- I created a .css file with the following contents (3 lines!)
- With this file, I then uploaded it to a library in SharePoint (any will work).
- Then, a bit tricky, you need to tell the community site to use this custom CSS file, but you do not get the option to change this, or at least they do not give you the link to do this through site settings (the link would be under the Look and Feel section called Master Page).
- Luckily the page does exist but you have to enter the URL manually.
- The URL to this page is the following: _layouts/15/ChangeSiteMasterPage.aspx
- This would go at the end of your Community site URL. EX: http://sp2013.com/sites/magrest/community/_layouts/15/ChangeSiteMasterPage.aspx
- Doing so should take you to a page that looks like the following:
- Here, expand the Alternate CSS URL section.
- With this section expanded, select the “Specify a CSS file to be used by this site and all sites that inherit from it:
- This will then let you click Browse…
- Browse to where you saved the .css file and click ok
After adding this custom CSS file, your left navigation should be ready to go. Here is what my left nav looks like when this is applied.
Notice no more Site Contents! Pretty simple isn't it?
You could also do this through a Content Editor web part, and then just paste in the above CSS. This would only affect the page the Content Editor web part was placed on. If that is the need for just one page to not show this, I would go this route. Otherwise, if you want the entire site to be affected, go with the CSS file route.
IncWorx Consulting is a leading Microsoft Gold Partner focusing on SharePoint Consulting, SharePoint Support, and SharePoint Application Development.