In the parent page template is a macro with a sub menu to list all child pages. This works fine. However, I would like the child pages to have the same menu and show the other children so the user doesnt have to go back to the parent page to access the sub menu. Here is my sub menu:
Basically I need the sub menu to only ever show the children on the same level as the page selected.
Just in case the user wants to add a page to the child, the menu needs to work right down the heirarchy:
>Homepage >>Courses (parent) >>>Course1 (child) SELECTED - Course1 page would still show itself and the other 2 children >>>Course2 (child) >>>Course3 (child)
Also on a deeper lever:
>Homepage >>Courses (parent) >>>Course1 (child) >>>>>>Sub Course1>>>Sub Course1 (child/child) SELECTED - Sub Course1 page would still show itself and the other 2 children >>>>>>Sub Course2 >>>>>>Sub Course3 >>>Course2 (child) >>>Course3 (child)
I hope this makes sense?
I have put together a temprary solution but it is limited to a certain level:
I will try to help you out here. What if you´re doing something like this? Does it do what you want then. If not please don't hesitate to ask anything further :-)
XSLT Sub Menu Help Please
Hi all,
I have a main page that has child pages:
>Homepage
>>Courses (parent)
>>>Course1 (child)
>>>Course2 (child)
>>>Course3 (child)
etc etc
In the parent page template is a macro with a sub menu to list all child pages. This works fine. However, I would like the child pages to have the same menu and show the other children so the user doesnt have to go back to the parent page to access the sub menu. Here is my sub menu:
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName"/></xsl:attribute>
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
Any help would be great, thanks
Roger
Hi Roger,
Do you need to select siblings when you are on the child pages?
Alex
Hi alex,
Basically I need the sub menu to only ever show the children on the same level as the page selected.
Just in case the user wants to add a page to the child, the menu needs to work right down the heirarchy:
>Homepage
>>Courses (parent)
>>>Course1 (child) SELECTED - Course1 page would still show itself and the other 2 children
>>>Course2 (child)
>>>Course3 (child)
Also on a deeper lever:
>Homepage
>>Courses (parent)
>>>Course1 (child)
>>>>>>Sub Course1>>>Sub Course1 (child/child) SELECTED - Sub Course1 page would still show itself and the other 2 children
>>>>>>Sub Course2
>>>>>>Sub Course3
>>>Course2 (child)
>>>Course3 (child)
I hope this makes sense?
I have put together a temprary solution but it is limited to a certain level:
<xsl:param name="currentPage"/>
<xsl:variable name="level" select="2"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=2 and @isDoc]/*[@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:if test="@id = $currentPage/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:attribute name="title"><xsl:value-of select="@nodeName"/></xsl:attribute>
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
But this is a problem if the user wants to add more sub pages, then the levl would be 3/4/5 etc and this solution is limited to level 2
Thanks
Roger
hey roger i have a same problem with you, can you tell me what must i do? thanks before
**sorry for my bad english (:
Hi Ipangh,
I will try to help you out here. What if you´re doing something like this? Does it do what you want then. If not please don't hesitate to ask anything further :-)
Hope this helps,
/Dennis
is working on a reply...