Pages

Sunday, February 3, 2013

SharePoint 2013 - Remove recent in the quick launch

SharePoint 2013 contains a new feature that creates a Recent shortcut in the quick launch. This shortcut appears after creating a new app. One of our customers doesn't want to use this feature. There is only NO out-of-the-box feature to remove it. Very strange. I asked on SPYAM how to remove the shortcut. I received the following answer from Jussi Roine:

The Recent-section gets added automatically through a WebControl on the page. To automatically remove the who section (including child navigation nodes of Recent) you could enable a custom feature, that simply does a .Delete() against the corresponding navigation node in SPWeb.Navigation.QuickLaunch navigation collection. 

Then just call your custom feature from your provisioning logic, and way Recent -section would always be removed upon provisioning a new site. 
Alternatively you could use some CSS-styling but that wouldn't really remove it, but just hide.


Hopefully this can set you in the right direction. Thanks Jussi!

Edit


Thanks to my visitors for leaving valuable replies! Another solution is:

jQuery(document).ready(function() {
 jQuery(".ms-core-listMenu-item:contains('Recent')").parent().hide();
});

7 replies:

Anonymous said...

We have been wondering this too. Thanks Jussi & Jasper!

Anonymous said...

Wow. So frustrating. Adding a feature that no one wants and can't be disabled. Go MS!

Anonymous said...

What I did:
Added a jQuery reference to my master page and added the following script to the end of these closing tags. If you use $(document).ready, you see the updating of the page.

This script gets rid of it as it is created. SharePoint:SPTreeView SharePoint:SPRememberScroll Template_Controls
SharePoint:DelegateControl
SharePoint:SPNavigationManager
script type="text/javascript">
var parent = $("span.additional-background:contains('Recent')").parent();
var parentul = parent.parents("ul");
var childli = $(parentul).find("ul");
parent.replaceWith(childli.html());
childli.remove();
parent.hide();
script>

Anonymous said...

http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneral/thread/ea3cd462-e861-4850-bfb3-f259ec8772ed

Unknown said...

Thanks for sharing Jasper and Jussi!

Anonymous said...

Thanks for sharing! I like the idea here and I've created a sandbox solution which remove the "Recent" node via JavaScript Client Object model asynchronously. This is good for both online and on-prem.
http://tommdaly.wordpress.com/2014/01/08/permanently-removing-the-recent-node-from-quick-launch-for-sharepoint-2013/

Unknown said...

Awesome Tom! I immediately Tweeted it :)

Post a Comment