yet another autonav question re homepage as parent
Permalink 1 user found helpful
hi there, I hve searched the posts on the site first (for over 1.5 hours now lol) and just wondered if anyone can help with this:
basically all I want is for parent items in my nav to appear highlighted when someone is in a child page.
This is easy enough with the default classes and css
for eg I am using:
#sectionLinks ul li a.nav-selected, #sectionLinks ul li a.nav-path-selected {
background-color: #84a13f;
display:block;
height:24px;
width:224px;
margin-left:-5px;
padding-left:5px;
padding-top:5px;
margin-top:-4px;
color: #fff;
}
#sectionLinks ul li ul li a.nav-selected {
background-color: #a4c25b;
display:block;
height:24px;
width:214px;
margin-left:-5px;
padding-left:5px;
padding-top:5px;
margin-top:-4px;
color: #fff;
}
BUT BUT BUT - this gets screwed becuase 'the whole site' is a child of the homepage.
Therefore the home link is always highlighted (has nav-path-selected applied)
How can I stop the homepage being regarded as a parent?
From searching this forums I am confident someone will answer "create a custom template for the autonav" - which I am sure is great advice ... but if you could be more specific that would be super awesome :D :D
I have been staring at the view.php code of the autonav for a while now and the answer is not hitting me...
basically all I want is for parent items in my nav to appear highlighted when someone is in a child page.
This is easy enough with the default classes and css
for eg I am using:
#sectionLinks ul li a.nav-selected, #sectionLinks ul li a.nav-path-selected {
background-color: #84a13f;
display:block;
height:24px;
width:224px;
margin-left:-5px;
padding-left:5px;
padding-top:5px;
margin-top:-4px;
color: #fff;
}
#sectionLinks ul li ul li a.nav-selected {
background-color: #a4c25b;
display:block;
height:24px;
width:214px;
margin-left:-5px;
padding-left:5px;
padding-top:5px;
margin-top:-4px;
color: #fff;
}
BUT BUT BUT - this gets screwed becuase 'the whole site' is a child of the homepage.
Therefore the home link is always highlighted (has nav-path-selected applied)
How can I stop the homepage being regarded as a parent?
From searching this forums I am confident someone will answer "create a custom template for the autonav" - which I am sure is great advice ... but if you could be more specific that would be super awesome :D :D
I have been staring at the view.php code of the autonav for a while now and the answer is not hitting me...
In your copied view.php find this line
(mine was on line 63, in version 5.4.0.5)
Change it to
Haven't tested it, but it should work.
The home page's ID is always 1 by default.
So we're saying that the home page can be highlighted as the page we're on, but never as part of the selected path.
Hope that helps!