Introduction
This tip will help you to hide the top ribbon on the Sharepoint site collection.
- Navigate SharePoint Site and click Sit Settings from Setting Menu
- Click Master Pages and Page Layouts link in Web Desginer Galleries section
- Download seattle.html page
- Make the following changes in the masterpage code
Add the below code before s4-workspce div
" <div id="s4-workspace" class="ms-core-overlay">
"
The JavaScript code document.getElementById("ms-designer-ribbon").style.display = "block";
will be executed only if the logged on user is site collection administrator, because we set the permission string
value as "FullMask
". If you want to hide the menu only for anonymous user, then change the PermissionString
as AnonymousUsersOnly
. The permission string
possible values are given below:
<!--MS:<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2"
runat="server" PermissionsString="FullMask">-->
<script type="text/javascript">
document.getElementById("ms-designer-ribbon").style.display = "block";
</script>
<!--ME:</Sharepoint:SPSecurityTrimmedControl>-->
History
- 5th July, 2016 - Initial version created