I am trying to show a basic sub navigation from 2 levels in on a top page...
Example:
Page (show sub nav here) - InnerPage (don't show this page) - - InnerInnerPage 1 (show this plus the following inner inner pages) - - InnerInnerPage 2 - - InnerInnerPage 3
Make sense?
Here is the code I thought would work... but it doesn't.
Have you lookedfor one of thepredefinedxsltsnippetscoulddo the jobfor you.HereIthink of the one calledListSubpagesByLevel. ThisXSLTfile containsthe following code:
Variableindicates thelevelitshouldstart.So maybeyoucouldtryto see if itcansolveyour problem..
Ok so Kim... thank you for smacking me upside the head with that :) I totally was using the pages node name not doc type. Not sure what I was thinking.
Sub Navigation Question...
I am trying to show a basic sub navigation from 2 levels in on a top page...
Example:
Page (show sub nav here)
- InnerPage (don't show this page)
- - InnerInnerPage 1 (show this plus the following inner inner pages)
- - InnerInnerPage 2
- - InnerInnerPage 3
Make sense?
Here is the code I thought would work... but it doesn't.
<ul>
<xsl:for-each select="$currentPage/InnerPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
Any ideas?
Thanks,
Tony
Hi Tony,
Have you looked for one of the predefined xslt snippets could do the job for you. Here I think of the one called List Subpages By Level.
This XSLT file contains the following code:
Variable indicates the level it should start. So maybe you could try to see if it can solve your problem..
Hope this can help you.
/Dennis
Hi Tony
The reason why your subanvigation doesn't work is probably because the "InnerPage"-node's document type is not called InnerPage, or am I wrong?
If you only want to show the navigation on the "Page"-node (using a for-each), you should be able to do this:
<ul>
<xsl:for-eachselect="$currentPage/*[@isDoc]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<ahref="{umbraco.library:NiceUrl(@id)}">
<xsl:value-ofselect="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
You could use a xsl:apply-templates, sinstead of the for-each, but either way the result should be the same of course :)
I guess that you've only inserted the macro on the page where the subnavigation should be shown.
By the way, Dennis approach should work as well...
/Kim A
Thanks for the replies!
Ok so Kim... thank you for smacking me upside the head with that :) I totally was using the pages node name not doc type. Not sure what I was thinking.
Working great now.
Thank you very much for helping me through that
Tony
Hehe, you're more than welcome Tony. We all make mistakes once in a while right :)
Glad it worked!
/Kim A
is working on a reply...