My current XSLT is creating the list but adding the parent node, into the child node list. So I'm getting a repeat of the parent node in the child node list.
Also I want to add a "current" CSS style to the current "li", and for any parent nodes to display as current if the child node is current.
<xsl:output method="xml" omit-xml-declaration="yes"/> <!-- update this variable on how deep your navigation should be --> <xsl:variable name="level2" select="$currentPage/ancestor-or-self::* [@level = 2]" /> <xsl:variable name="level3" select="$currentPage/ancestor-or-self::* [@level = 3]" /> <!--<xsl:variable
name="level3" select="$currentPage/ancestor-or-self::* [@isDoc and
@level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/> <xsl:variable
name="level4" select="$currentPage/ancestor-or-self::* [@isDoc and
@level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']"/>-->
<xsl:output method="xml" omit-xml-declaration="yes"/> <!-- update this variable on how deep your navigation should be --> <xsl:variable name="level2" select="$currentPage/ancestor-or-self::* [@level = 2]" /> <xsl:variable name="level3" select="$currentPage/ancestor-or-self::* [@level = 3]" /> <!--<xsl:variable name="level3" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/> <xsl:variable name="level4" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']"/>-->
Good if you got i working. For Unlimited Levels the same thing should be apply. So everytime you will need to run a test to see if any child nodes are available.
Multi-level 2nd level menu with "Current" style
I'm creating a multi level 2nd level menu.
My current XSLT is creating the list but adding the parent node, into the child node list. So I'm getting a repeat of the parent node in the child node list.
Also I want to add a "current" CSS style to the current "li", and for any parent nodes to display as current if the child node is current.
Can anyone help me fix these two issues?
Cheers, JV
I've got the "current" state working for the current "li".
But I'm still getting the parent node repeating in the child node list.
Example of results:
About
What we do
---What we do (The parent is repeated here!)
---Who we are
---Where we come from
Our staff
etc
Here's my updated XSLT:
Hi JV,
You could also do something like
Hope it helps
Hi Fuji,
Thanks for that, I've made some amends to your suggestion and have got it work to level 4.
However I want something that I could have unlimited levels, but have a variable for it stop at a maximum amount of levels.
Here's the amended XSLT:
Hi JV,
Good if you got i working. For Unlimited Levels the same thing should be apply. So everytime you will need to run a test to see if any child nodes are available.
//fuji
Hi Fuji,
Can you show me an example of how your suggestion would work for unlimited levels?
Cheers, JV
is working on a reply...