Thursday, July 30, 2009

Audience Targeting for Quick Launch using CEWP in SharePoint

I have seen this query in communities to hide the Quick Launch for a user group / particular audience. Most of the SharePoint developers know that Content Editor Web Part can be used to hide the Quick Launch bar.

To achieve the same, add the CEWP to the page, where you do not want to display the Quick Launch. Open Source Editor of CEWP and add the following

<style>
.ms-quicklaunch
{
display:none;
}
.ms-navframe
{
display: none;
}
</style>


Once the above <style> has been added, go to Advance Setting, set “Audience Targeting”. Set the group/audience to which you do not want to display the Quick Launch bar.

I have set the “Visitors” group in Audience Targeting. This setting will not allow the “Visitors” to see the Quick Launch bar.

I have a moss_user1 in Visitors Group and moss_user2 in Members Group.



The below screen hides the Quick Launch for moss_user1 (Visitors Group)



See the following screen, which shows the Quick Launch for moss_user2 (Members Group)


This approach will work for a single page, if you want the same to apply for all pages then add the CEWP to the master page with the above specified settings.

No comments: