Forum Discussion
Nigel_Price9911
Nov 15, 2017Iron Contributor
IS it Possible to remove the left hand nav from a modern team site
Hi
Is it possible to remove the left hand navigation bar from a modern team site so that If I use a Hero Web Part it can take up the whole of the screen ?
Then can I put the old search box in the top right hand corner of the screen and point it to a classical Search Results page where I have refiners etc ?
Thanks
Nigel
I think the supported way to do this would be to write an extension (so it is applied to all pages in the site) that implements CSS to make the changes you are after.
The CSS to hide the left hand nav on a modern page is:
nav[role='navigation'] { display: none !important; } div[class^='searchBox_'] { display: none !important; } div[class^='pageContainer_'] { left: 0 !important; }
The same extension that injects this CSS could also display a search box (if you want it on every page), that redirects users to your search results page and injects the query into the 'k' querystring parameter
hope it helps,
Nigel
- G_Vijai_KumarCopper Contributor
The best way is to delete all left side navigation links then reload the page, quick launch disappears. It works.
Best Regards,
G Vijai Kumar
- nlvraghavendraCopper ContributorThis is the only solution that worked for me in a SharePoint modern team site.
- dancourcellesCopper Contributor
Nigel_Price9911 I found that you can hide the div in a CSS stylesheet. Just replace the red text below with the id for your div and it should hide it. I've noticed that the div changes after a while which means I need to go update the id for that div but it works well otherwise.
div.spNav_1846ed68 {position: absolute; visibility: hidden; display: none !important;}- PCH_MarkCopper Contributor
dancourcelles I was building personal pages for employees that don't require LHS navigation and was able to remove it from "Site Settings" -->"Navigation" --> "Structural Navigation: Editing and Sorting". Select "Current Navigation" and delete all items in the list. Click OK. As a note, this removed the navigation, but you can't use the column space that was vacated by the navigation. So even with a 4 column layout (3 columns plus the vertical column), the columns just float left and the (now empty and unusable) fifth column floats to the right hand side of the page.
- Angus MuirCopper Contributor
In modern pages you can do this without css - just in site settings, Navigation Elements -> uncheck Quick launch
- BejeweledOneBrass Contributor
Angus Muir That doesn't seem to work, at least now in my modern site.
- Aseem AnandCopper Contributor
Yes, It can be done. Go to Site Settings -> Navigation Elements (under Look and Feel).
Uncheck "Enable Quick launch". This should remove the left navigation pane.
- Jason BrownhillBrass Contributor
Sometimes the simplest solutions are always the last to be suggested, thanks for that!
- Chad RenstromCopper Contributor
I found the answer without using any stylesheets. Under Site Settings -> change the look, then select the current look, ten on the next page change the Site Layout to Oslo.
- Dean_GrossSilver Contributor
Chad Renstromwhat kind of site are you doing that on? when i try it on a modern group enabled team site, it does not work on the home page.
- Nigel WitherdinIron Contributor
I think the supported way to do this would be to write an extension (so it is applied to all pages in the site) that implements CSS to make the changes you are after.
The CSS to hide the left hand nav on a modern page is:
nav[role='navigation'] { display: none !important; } div[class^='searchBox_'] { display: none !important; } div[class^='pageContainer_'] { left: 0 !important; }
The same extension that injects this CSS could also display a search box (if you want it on every page), that redirects users to your search results page and injects the query into the 'k' querystring parameter
hope it helps,
Nigel
- Oleg RumiancevCopper Contributor
Thanks Nigel, that's what I am trying to do from the extension.
Did you notice a that left nav is still rendered for a split second before our application customizer actually loads?
- Nigel WitherdinIron Contributor
Hey,
mine is actually running from a web part on the page (not a customizer) and yes it definitely shows the LHS nav for a flicker before the CSS is processed.
There may be a better way to get the CSS processed earlier in the page load, but I am not sure how/what is the best way to achieve that - sorry.
If you do find out, please post the solution on this thread as it would be good to know
Thanks
Nigel
- Nigel_Price9911Iron Contributor
Thanks Nigel - it certainly does.
- PittSharePointProIron ContributorBump