I'm trying to convert a 4.0 XSLT subnavigation template to 4.5 and have hit a wall. First the working 4.0 XSLT
4.0 XSLT - Works <xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1']) > 0 and (($currentPage/ancestor::node[@level=2]/@id = ./parent/@id) or ($currentPage/@id = @id) or ($currentPage/ancestor::node[@level=2]/@id) = @id) "> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="." /> </xsl:call-template> </ul> </xsl:if>
If I have a node tree like: Home |-Item1 |-Item2 |-Sub Item 1 |-Sub Item 2 |-Sub Item 3 |-Item3
When The user is on 'Home', or any of the top items, they should only see the top items. If they're on 'Item2' or 'Sub Item2', they should see the sub item navigation. I've tried checking the current ID in the loop against: -currentPage/ancestor::* [@level=2]/@id" /> -currentPage/node::*/@id" />
And pretty much everything else. So far the closest I've found is:
4.5 XSLT - Closest match I've found <xsl:if test="count(* [@isDoc and string(umbracoNaviHide) != '1']) > 0"> ...
This must be possible in 4.5, I'm sure I just don't have the right XSLT.
4.5 Subnavigation
I'm trying to convert a 4.0 XSLT subnavigation template to 4.5 and have hit a wall. First the working 4.0 XSLT
4.0 XSLT - Works
<xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1']) > 0 and (($currentPage/ancestor::node[@level=2]/@id = ./parent/@id) or ($currentPage/@id = @id) or ($currentPage/ancestor::node[@level=2]/@id) = @id) ">
<ul>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="." />
</xsl:call-template>
</ul>
</xsl:if>
If I have a node tree like:
Home
|-Item1
|-Item2
|-Sub Item 1
|-Sub Item 2
|-Sub Item 3
|-Item3
When The user is on 'Home', or any of the top items, they should only see the top items. If they're on 'Item2' or 'Sub Item2', they should see the sub item navigation. I've tried checking the current ID in the loop against:
-currentPage/ancestor::* [@level=2]/@id" />
-currentPage/node::*/@id" />
And pretty much everything else. So far the closest I've found is:
4.5 XSLT - Closest match I've found
<xsl:if test="count(* [@isDoc and string(umbracoNaviHide) != '1']) > 0">
...
This must be possible in 4.5, I'm sure I just don't have the right XSLT.
Echilon,
Flexible cognavigation is your friend it does expanding tree nav and much more and is now 4.5 compatible see http://our.umbraco.org/projects/website-utilities/cogworks-flexible-navigation
Regards
Ismail
Thanks, I'll remember the template for future. :)
is working on a reply...