1

We have a left side navigation that is sometimes populated with sub page links and sometimes not (it really depends on whether the page has children or not). We want to remove the navigation on a page by page basis. Is this possible?

I've seen it where I can change master page on a site by site basis, but what about on a specific page?

2 Answers 2

1

Dirty way of doing it but, create and add a user control to all pages, in user control's on load method, check if web has any pages in pages library or other possible ways, if it does then change the master page url for the web.

Get count of publishing Pages

SharePoint: Dynamically Change Master Page

OR if i didn't understood you properly then,

Using a Page Specific Master Page in SharePoint 2010

2
  • 1
    I like the article on using a page specific master page, however, it doesn't really detail where I go in the editor to adjust the code. Apr 15, 2014 at 13:11
  • 1
    oh... I see now, you need to have sharepoint designer to do the things in the last link. I was trying to use visual studio. Apr 23, 2014 at 14:28
0

Pages will always inherit the master page from the parent site, if you set a master page with a side bar in the top site all the sub pages will have the menu.

You can remove it page by page using a javascript, you just need to add a content editor webpart to the pages where you don't want the vertical menu and add the script inside of it.

For the settle master page you can use something like this.

<script type="text/javascript">    
    document.getElementById("sideNavBox").style.display = "none";
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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