Saturday, 30 July 2011

Hide Ribbon, Ribbon Tabs,Groups,Ribbon Button from SharePoint Pages with CSS


To Hide Ribbon -  Open the master page and look for the following 

<div class="s4-pr s4-ribbonrowhidetitle" id="s4-ribbonrow">
Change it to
<div class="s4-pr s4-ribbonrowhidetitle" id="s4-ribbonrow" style="display: none;"></div>

Show\Hide Ribbon for users with Privileges - Edit the master Page add and the SPSecurityTrimmedControl around s4-ribbonrow

<sharepoint:spsecuritytrimmedcontrol id="SPSecurityTrimmedControl2" permissionsstring="AddAndCustomizePages" runat="server">
<script type="text/javascript">
        document.getElementById("s4-ribbonrow").style.display = "block";
    </script>
</sharepoint:spsecuritytrimmedcontrol>

To Hide Tabs - Add the below in Master Page CSS or in a content editor webpart on the Page where you want to hide the tab. We can hide the Ribbon.EditingTools tab with this

<style>
.ms-cui-cg
{
display:none;
}
</style>
</div>

Ads by Google

No comments:

Post a Comment