my main page is having 4 childs (lvl1) each of them having few more childs (lvl2)
Main Page A Page A1 Page A2 Page A3
Page A4 Page B
Page B1
Page B2 Page C
Page C1
Page C2
Page D
Page D1
Page D2
I would like to have menu on my "Main Page" showing only childs of "Page A" page ("Page A1", "Page A2", "Page A3" and "Page A4") and I'm not sure how to set select atribute to include only wanted pages...
I guess i need to write something like "<xsl:for-each select="$currentPage/ancestor-or-self::node//node [@level=2]/node">" but this one would obviously show childs of "Page B", "Page C" and "Page D" too.
you can check if a node is child of your currently selected node by using somethig like this <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
i use a similar approach to display my side navigation up to a certain level see the code below. What i hav done is to create a named-template to be call recursivly until a definend dapth is reached and I only get the links under the current page.
Xslt menu
Hello, everyone
I'm new in xslt so I need some help.
Here's the problem:
my main page is having 4 childs (lvl1) each of them having few more childs (lvl2)
Main
Page A
Page A1
Page A2
Page A3
Page A4
Page B
Page B1
Page B2
Page C
Page C1
Page C2
Page D
Page D1
Page D2
I would like to have menu on my "Main Page" showing only childs of "Page A" page ("Page A1", "Page A2", "Page A3" and "Page A4") and I'm not sure how to set select atribute to include only wanted pages...
I guess i need to write something like "<xsl:for-each select="$currentPage/ancestor-or-self::node//node [@level=2]/node">" but this one would obviously show childs of "Page B", "Page C" and "Page D" too.
Thanks in advance.
Hi,
you can check if a node is child of your currently selected node by using somethig like this <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
i use a similar approach to display my side navigation up to a certain level see the code below. What i hav done is to create a named-template to be call recursivly until a definend dapth is reached and I only get the links under the current page.
Hope this helps
Toby
Thank You alot for Your reply, I've managed to solve my problem now.
is working on a reply...