Month: September 2014
Hide SharePoint “RibbonRow” and “SuiteBar” From Anonymous Users
For public facing SharePoint sites most of the time peoples don’t want to show SharePoint “Suitebar” and “RibbonRow” for Antonymous Users
So here how you can hide SharePoint 2013 “suiteBar” for anonymous users.
- Open the master page (default Master and the Home Page Master) using SharePoint Designer. Before edit your master page take a backup copy
2. Select your master page -> right click –>Click on “check out”
3. Select the master page again -> right click –> Click on “edit file in advanced mode”
4. Find the <div id=”suiteBar” class=”ms-dialogHidden noindex”> code block
5. Now change <div id=”suiteBar” class=”ms-dialogHidden noindex”> to <div id=”suiteBar” class=”ms-dialogHidden noindex” style=”display:none”>
This will hide the “suitbar” for all users including login users.but we need to enable suite bar for login users.to do that insert below script block right after the above </div> tag
6.Right click on <div id=”suiteBar” class=”ms-dialogHidden noindex”> to <div id=”suiteBar” class=”ms-dialogHidden noindex” style=”display:none”> code block and click on “Select Tag”
7. insert below script block right after the selected section
<!– My Custom Code –>
<SharePoint:SPSecurityTrimmedControl ID=”HideSuiteBar” runat=”server” PermissionsString=”ManageWeb”>
<script type=”text/jscript”>
document.getElementById(“suiteBar”).style.display = “block”;
</script>
</SharePoint:SPSecurityTrimmedControl>
<!– –>
This will hide SharePoint “SuiteBar” for Anonymous users.
Now we have to hide SharePoint “Ribbon Row”
8.Go to your master page. find <div id=”s4-ribbonrow” style=”height: 35px; display: inherit !important;”> code block.
9. Change <div id=”s4-ribbonrow”> to <div id=”s4-ribbonrow” style=” display:none”>
10. Right click on <div id=”s4-ribbonrow” style=” display:none”> code block -> click on “Select Tag”
11. Insert below script block right after the above selected </div> tag. (at the end of the Selected Tag)
<!– My Custom Code –>
<SharePoint:SPSecurityTrimmedControl ID=”HideRibbonRow” runat=”server” PermissionsString=”ManageWeb”>
<script type=”text/javascript”>
document.getElementById(“s4-ribbonrow”).style.display = “block”;
</script>
</SharePoint:SPSecurityTrimmedControl>
<!– –>
12. After Insert above code block .your page will look like below screenshot.
13. “Save” your changes and “Check In” the “Master Page”.
14. This is the final output / View for “anonymous” users.
Note :
You have to “Deactivate”Minimal Download Strategy” feature from “Manage Site Features” to take effect all these changes.
You can use below url to login to you site.because now you can’t see “Sign in” Link on your pages. 🙂
http://SiteUrl/_windows/default.aspx
Happy Coding
SharePoint Brunei User Group
I’m really happy to announce that i will be speaking at the SharePoint Brunei User Group in Brunei, September 20 2014. http://www.sharepointbrunei.net/