1) Open the master page file in the SharePoint designer.
2) Add the style tag to hide the ribbon for all the user:
#s4-ribbonrow, #suiteBar { display : none; }
3) Now we have to do some more changes so that at least system account can access the ribbon. Find out the <div id=”s4-ribbonrow”> tag.
4) Insert the following code inside this div:
<!—MS:<SharePoint:SPSecurityTrimmedControl ID=”SPSecurityTrimmedControl2″ runat=”server” PermissionsString=”AddAndCustomizePages”>—>
<script type=”text/javascript”>
document.getElementById(“s4-ribbonrow”).style.display = “block”;
document.getElementById(“suiteBar”).style.display = “block”;
</script>
<!—MS:</SharePoint:SPSecurityTrimmedControl>—>
<script type=”text/javascript”>
document.getElementById(“s4-ribbonrow”).style.display = “block”;
document.getElementById(“suiteBar”).style.display = “block”;
</script>
<!—MS:</SharePoint:SPSecurityTrimmedControl>—>
5) Now save the master page and deploy or publish it to see the changes.
Share This :



comment 0 komentar
more_vert