I was kindly helped, last week, to correctly display my top level navigation where the first and last list items have a different class. I am now trying to get my sub level navigation to work but it is not displaying.
I am trying to create a structure similar to the following:
you won't get a sub level nav when you're on the sub level page because you're using the $currentPage param in the inner for-each loop, I think you need to replace
where '.' (dot) refers to the current page being processed in the outer-loop
Also, do you need to list all sub level pages (top level 1 & top level 2) or only sub level pages from a single parent (either top level 1 or top level 2). Current code will only work in second scenario.
Chriztian, your code has made my sub level visible as I would like but it is displaying ALL sub levels where I need only the sub level pages from a parent to display (as Dirk mentions) - ideally on hover of the button. I am not sure how to incorporate Dirk's suggested code within Chriztian's code?
I'm a bit confused - you're talking about hovering to see the sublevels? If that's the effect you're after, you should probably combine my XSLT above with some CSS to hide the sublevels, revealing only one at a time, right?
Take a look at the "Son of Suckerfish Dropdowns" from HTML Dog for an easy solution to this.
Hope I didn't misunderstand you completely there...
I think it's actually my css that is not working - I had it working in a plain html file but it's not working through my xslt. I think I just need to keep tweaking!
Sub Level Navigation is not displaying
Hi,
I was kindly helped, last week, to correctly display my top level navigation where the first and last list items have a different class. I am now trying to get my sub level navigation to work but it is not displaying.
I am trying to create a structure similar to the following:
<ul id="mainNav">
<li><a href="#" class="main" id="mainNavLeft">Home</a></li>
<li><a href="#" class="main">Top Level 1</a>
<ul>
<li><a href="#">Sub Level Item></a></li>
<li><a href="#">Sub Level Item</a></li>
<li><a href="#">Sub Level Item</a></li>
<li><a href="#">Sub Level Item</a>
</ul>
</li>
<li><a href="#" class="main">Top Level 2</a>
<ul>
<li><a href="#">Sub Level Item></a></li>
<li><a href="#">Sub Level Item</a></li>
<li><a href="#">Sub Level Item</a></li>
<li><a href="#">Sub Level Item</a>
</ul>
</li>
<li><a href="#" class="main">Top Level 3</a></li>
<li><a href="#" class="main">Top Level 4</a></li>
<li><a href="#" class="main">Top Level 5</a></li>
</ul>
The code I have is:
But I am having problem getting the sub nav to show?
Thanks,
Rachel
Hi Rachel,
Try this and let me know if that's what you're after:
/Chriztian
Hi Rachel,
you won't get a sub level nav when you're on the sub level page because you're using the $currentPage param in the inner for-each loop, I think you need to replace
in inner loop with
where '.' (dot) refers to the current page being processed in the outer-loop
Also, do you need to list all sub level pages (top level 1 & top level 2) or only sub level pages from a single parent (either top level 1 or top level 2). Current code will only work in second scenario.
Hope this helps.
Regards,
/Dirk
Hi both, thank you very much for your responses.
Chriztian, your code has made my sub level visible as I would like but it is displaying ALL sub levels where I need only the sub level pages from a parent to display (as Dirk mentions) - ideally on hover of the button. I am not sure how to incorporate Dirk's suggested code within Chriztian's code?
Thanks,
Rachel
Hi again,
I'm a bit confused - you're talking about hovering to see the sublevels? If that's the effect you're after, you should probably combine my XSLT above with some CSS to hide the sublevels, revealing only one at a time, right?
Take a look at the "Son of Suckerfish Dropdowns" from HTML Dog for an easy solution to this.
Hope I didn't misunderstand you completely there...
/Chriztian
Hi Chriztian,
I think it's actually my css that is not working - I had it working in a plain html file but it's not working through my xslt. I think I just need to keep tweaking!
Thanks,
Rachel
is working on a reply...