Sometimes, whether you're creating a public site that will enable anonymous access to visitors, or you're creating a site internal to an organization, you may want to hide the View All Site Content (VASC) link. This link sits in the quick launch and gives users access to a page listing all the content within your SharePoint site.
It's an easy enough task, but there are quite a few ways to accomplish the same thing. The link itself is part of a Sharepoint:SPSecurityTrimmedControl in the mater page. If you have access to SharePoint Designer and you feel comfortable modifying the master page for this site you can use the following approach.
Inside your master page you'll want to select the VASC link and looking in the code view find the following control that corresponds to it:
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="BrowseDirectories"> <div class="ms-quicklaunchheader"><SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></div> </SharePoint:SPSecurityTrimmedControl> |
This control can be modified in a couple of ways. You can either set an additional property or modify the value for an existing property. With ASP.net it is simple to go into a tag and add the property visible="false". This will hide the control without removing it from the master page code.
However, there is another way...
In this particular control we already have a property which sets permissions for visibility, it's the PermissionsString property and is currently set to the value "ViewFormPages". There is another value that will easily hide this control from site visitors who are anonymous access users, i.e. "readers". By setting the control to have the value "BrowseDirectories" you will hide it from these users, but retain it for your users with the Design or Owner permission levels.
Furthermore, you could just delete it entirely from the master page, however that's not recommended in the event you would want to avoid removing the control for all users and throughout the site. It's always best to use what's already built-in for you, so my suggestion is to modify the PermissionsString property value in order to get the results. No harm, no foul and it's easy enough to change later on.
Finally, there are solution packages out there that will do the same thing. The benefit of using these solution packages over this method here are three-fold. One, you can easily deploy the solution and activate the feature to hide VASC on any site you need to. Two, you can also avoid modifying the master page, which isn't always best practice. Finally, this feature lets you hide the VASC link, while adding it to the Site Actions menu. Pretty nifty for someone who can't/won't be modifying the master page themselves.
Final note, let's say you've hidden the VASC link manually by editing the master page and now you'd like it to appear in the Site Actions menu instead. That is an easy fix and since we're on the topic here's what you need to do to add that control to the Site Actions drop down...
In SharePoint Designer you'll want to select the Site Actions menu and look in the code view to find the SharePoint:SiteActions control...
You are going to add a control within these tags after the first MenuItemTemplate…
<SharePoint:SiteActions runat="server" AccessKey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain" PrefixHtml="<div><div>" SuffixHtml="</div></div>" MenuNotVisibleHtml="&nbsp;"> <CustomTemplate> <SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true" > <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="<%$Resources:wss,viewlsts_pagetitle_create%>" Description="<%$Resources:wss,siteactions_createdescription%>" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="100" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/create.aspx" PermissionsString="ManageLists, ManageSubwebs" PermissionMode="Any" /> … </SharePoint:FeatureMenuTemplate> </CustomTemplate> </SharePoint:SiteActions> |
In order to add another link to the drop down we simply need to create another MenuItemTemplate entry. We will be adding the View All Site Content link which is a link to /_layouts/viewlists.aspx page. By adding the code below under the last MenuItemTemplate entry within the SharePointSiteActions control, you will have the ability to choose View All Site Content from the Site Actions menu anywhere on the site.
Paste this code within the MenuItemTemplate code block:
<SharePoint:MenuItemTemplate runat="server" id="ViewLists" Text="View All Site Content" Description="Browse all site lists and subsites" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="300" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/viewlsts.aspx" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs, AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData" PermissionMode="Any" /> |
Using this technique you should be able to hide the VASC control from the quick launch and add it to the Site Actions menu. Of course users will still be able to navigate to the viewlists.aspx page, but most of them won't even know it exists. You can use this same method to hide the Recycle Bin, which is also a separate control within the quick launch and can also be added to the Site Actions menu if needed.