Loading...

Thursday, September 13, 2012

Role Based Navigation:Role Based QuickLaunch

Its the common requirement  everywhere to create the RoleBased QuickLaunch and Global Navigation
Following code snippet hides the Firstnode of Quick Launch for Users other than owners and admins,
To implement this
Edit the Master Page in SPD and add this css along with SPsecurity Trimmed Control in head section of master page(Only in following sequence)

1)Following css will be available for all users

<style type="text/css">
/* mainlinks */
.menu-vertical > ul.root > li.static:first-child > .menu-item{

display:none;
}
/* Sublinks */
.menu-vertical > ul.root > li.static:first-child   > ul.static  {

display:none;
}

</style>
2)Following css will be only  available for Owners/admins

<SharePoint:SPSecurityTrimmedControl ID="sitePerms" PermissionsString="ManageWeb" runat="server">
 <style type="text/css">
 /* mainlinks */
.menu-vertical > ul.root > li.static:first-child > .menu-item{

display:block;
}
/* Sublinks */
.menu-vertical > ul.root > li.static:first-child   > ul.static  {

display:block;
}

 </style>
</SharePoint:SPSecurityTrimmedControl>


For extensive branding of QuickLaunch following links are very useful

To Deploy , create the feature to replace the existing master page


No comments: