1

As you can see from this screenshot, the Home link is active in my current navigation (powered by managed metadata) as I'm on the homepage. Under Company are five links, all of which I would like to hide unless the Company link is active.

Screenshot of navigation menu with Home link active

How can I do this? Do I need to configure something in the term store, or do I need to edit the source code using SharePoint Designer?

1

use css and Jquery:

 $('#nav li:has(a.active) > a').addClass('active');

 #nav {
background-color:#F36F25;
margin:0 0 5px 0;
width: 100%;
height:35px;
left:0;
z-index:1;
border-top:2px solid #FFFFFF;
border-bottom:2px solid #FFFFFF;
}
#nav>li {
float:left;
list-style:none;
}
#nav li:hover ul {
position:absolute;
display:block;
z-index:9999;
}
#nav li a {
display: inline-block;
padding: 8px;
margin:0;
background: #F36F25;
text-decoration: none;
color: #FFFFFF;
border:1px solid #F36F25;
 }
 #nav li:hover > a, 
 #nav li a.active{
color:#F36F25;
background: #FFFFFF;
border:1px solid #F36F25;
cursor:pointer;
}
#nav li ul {
position:absolute;
display: none;
list-style:none;
margin:0;
}
#nav li ul li {
margin-top:0;
margin-right:0;
margin-bottom:0;
margin-left:-40px;
}
#nav li ul li a {
background-color: #F36F25;
color:#FFFFFF;
border:1px solid #F36F25;
width:145px;
}
#nav li ul li a:hover {
background-color: #FFFFFF;
color:#F36F25;
border:1px solid #f36f25;
}
  • This works fine if you're on the top-level menu item, but going into a second-level item hides all of the second-level items. – Connor Gurney Feb 2 '18 at 6:49
0

Or go in Site Settings>Navigation>

Navigation screen shot

(BTW - I'm using SP 2013).

The navigation you are referring to is called 'Current Navigation'. Take note of the Radio Buttons giving different options - your navigation might be configured differently.

If you want to hide links from the 'Current Navigation' (left side of screen), scroll down further in the menu. I am using Structural Navigation, so menu looks as you see in the picture below (yours would look different if the navigation is configured differently to mine).

To remove a link, select it and then select delete. You might want to take a screen shot of your navigation and put it someone safe for reference in case anyone ever asks "which links did we used to have, there were some useful ones..."

Structural Navigation Settings

  • That lets you hide the items site-wide... I want to hide them until the user is browsing the page referenced in the parent link. – Connor Gurney Feb 2 '18 at 6:23
  • Hmm, you might need to be a bit more specific in your question, perhaps consider updating. I don't know of a way to achieve what you need though. Good luck with it. – Tally Feb 2 '18 at 8:40

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.