Apr 8, 2010

Hide View All Site Content on SharePoint Site

At times we need to hide certain things on the master page based on the user profile.

You might be finding blogs where people are coding or making these components invisible or commenting or deleting to hide them, Instead the method mentioned below is the correct way of doing the following:

  • hide View all site content
  • hide bread crumbs
  • hide My Links
  • hide My Site
  • hide help
  • hide left navigation

Highlighted below in the screen shot (logged in as site administrator):


Instead, simply open the master page using SharePoint Designer and using the split view
as shown below in the screenshot highlight the desired component to hide, in the example below i am using "My Site"


Now, lets add few lines to hide "My Site"

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageSubwebs">


<SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm" runat="server"/></td>

</Sharepoint:SPSecurityTrimmedControl>

as shown below:

Now login as the Site Administrator and some other account like site members.
Notice the difference, the My Site is gone.

Logged in with site member account


Code only when necessary!

keywords: SPSecurityTrimmedControl

No comments:

Pages