Sometimes, you will find the need to hide the left nav on a page in one of your sites. You could always click the focus on content button, but then you have to unclick to reset for any other page you browse to.
Hiding the left nav took a little more work in MOSS 2007. You would have to open SharePoint Designer and remove a couple of lines of code. Well, not anymore!
To accomplish this, go to your page and edit it. Add a Script Editor web part to any zone on your page. Add the following script to the web part:
<style>.ms-core-sideNavBox-removeLeftMargin{ DISPLAY: none }#contentBox { margin-left: 0px }</style>
Click Ok, and you’re done! Now, if you notice, the left margin properties are set to 0px. You may want to increase to 5px or 10px so that your page is not eating the left hand side of your monitor 🙂
If you want to hide all navigation from your page, use this script instead:
<style>.ms-core-navigation { DISPLAY: none }#contentBox { margin-left: 0px }</style>
Stay Salty!
Nice. Except you say nothing about hiding the top nav links!
THANK YOU!!!!!!
What should be so ridiculously simple to do has been a major challenge for me, and your solution is the only one I’ve come across that actually works!
One thing to note – I did this using a Content Editor Web Part, which I then hid by setting the Chrome to None. I did it this way because, for some reason, I do not have the option to export a Script Editor web part, and I need to use this on all of my pages. Since I’m not an SP admin, I can’t modify the master page, and needed something that let me apply this to each page.
Thanks again, this is GREATLY appreciated!
Bill, it is the last piece of styling listed in the post. It does say all navigation and not top so I can see where this would not be correct. I’ll change to the name of the post to reflect this.
Is it possible to get rid not only of the top nav but also the empty space that’s left after it disappears?