0

How can I hide the Current Navigation(left) from only the Site Pages(site collection).I would like to have it on Site Content level. I would like my Site Pages(in Page library) to be in full screen mode with no left navigation. Top navigation can be there

0

If you use Classic Experience, we can use Oslo master page to achieve it. If you only want to hide the left navigation in the site page in Site Pages library, we can add the following code into the seattle master page using SharePoint designer to achieve it.

<style>
#sideNavBox{
    display:none;
}
#contentBox{
    margin-left:0px;
}
</style>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
    if(window.location.href.indexOf("/SitePages/")==-1){
        $("#sideNavBox").show();
        $("#contentBox").css("margin-left","220px");
    }
})
</script>

If you use Modern Experience, we can add react script editor web part into the modern site pages with the CSS style below to hide the left navigation.

<style>
div[class^='spNav_']{
    display:none;
}
</style>

Or using SPFx Applications Customiser CSS Injection with CSS style above to achieve it.

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.