0

I am creating a Public Facing Site(Publishing Portal) in Sharepoint 2016. I want to hide two top bars which are shown in the screenshot so that they are not displayed to the end user. How can I achieve that using Sharepoint Server 2016?

Top Bars to be hidden for Public facing site.

3

To hide the ribbon as you highlighted for all users, try to add the below CSS in your master page.

#suiteBarTop, #s4-ribbonrow
{
  display: none;
}

For the only suiteBar that contains SharePoint word and colored black, try this

#suiteBarTop
{
  display: none;
}
|improve this answer|||||
  • Is there any other way , apart from CSS to do this? – Pankaj Dalvi Feb 4 at 15:19
  • 1
    @PankajDalvi You could create a custom masterpage and remove the controls that correspond to the parts you don't want to display./ – Thriggle Feb 4 at 16:21
  • I can do that @Thriggle but what if my Administrator wants to Sign In and Edit the pages. In that case what should I do? – Pankaj Dalvi Feb 4 at 16:23
1

Add the following code into tag in master page to achieve it.

<script type="text/javascript">
window.onload = function() {
    if(_spPageContextInfo.userId==undefined){
        document.getElementById("suiteBar").style.display = "none";
        document.getElementById("s4-ribbonrow").style.display = "none";
    }   
}
</script>

Or we can use Security Trimmed Control to achieve it, check the article below.

Add a Security Trim snippet in SharePoint

|improve this answer|||||
  • Thanks for the code snippet @LZ_MSFT. I think this should help. – Pankaj Dalvi Feb 5 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.