Pages

Friday, April 21, 2017

SharePoint 2013 Foundation – Hide Recent from Left Navigation

The "Recent" section in the left navigation of SharePoint 2013 Foundation is incredibly annoying.  In my opinion, it’s something that should be off by default, but we should have a way to enable it as desired through the user interface.  Unfortunately, it’s on by default and if we want to turn it off, we can’t.  It’s not possible.


Hide “Recent” section on one page

1.       Edit the page
2.       Add a Content Editor Web Part to the page
3.       Paste this code into the Content Editor Web Part, making any changes you need to.
script type="text/javascript">
 $(document).ready(function() {
  $("#sideNavBox .ms-core-listMenu-item:contains(‘Recent’)").parent().hide();
 });
4.       Save/Check In/Publish the page and you’re done.

Hide “Recent” section on all pages

This assumes that all pages in your site collection are referencing the same master page.  Of course if you have multiple master pages and site collections, you’ll need to do this for each master page being used within each site collection.
1.       Edit the master page of your site in SharePoint Designer 2013 (other methods work fine as well).
2.       Add a reference to jQuery in the HTML section of your master page.
3.       Add the jQuery script to hide the “Recent” section within the “PlaceHolderAdditionalPageHead” content placeholder.
      script type="text/javascript">
 $(document).ready(function() {
  $("#sideNavBox .ms-core-listMenu-item:contains(‘Recent’)").parent().hide();
 });
4.       Save/Check In/Publish the master pages and you’re done.

No comments:

Post a Comment