The only issue is that ".comm-sub-nav" is not pulling through subnodes and I want them to appear underneath the correct parent node if that makes sense?
So the parent node is a doc type named "Country" and then underneath you have a doctype named "Community" - within the content section of umbraco you can create another "Community" page underneath a "Community" so what I have is a community within a community.
I need the 2nd level community to appear underneath the correct coresponding parent community node.
I hope this is specific enough - any questions I will be watching the thread.
Sub Navigation - XSLT
Hi Guys,
I have created a sub nav within xslt and is working fine - here is my code:
<xsl:param name="currentPage"/>
<xsl:variable name="level" select="4"/>
<xsl:variable name="subLevel" select="5"/>
<xsl:template match="/">
<xsl:if test="$currentPage/showCommunityDevelopmentProgrammes = '1'">
<div id="list-comm-develop-wrap">
<div id="comm-heading-wrap">
<span>
<xsl:value-of select="$currentPage/@nodeName" /> Community Development Programmes
</span>
</div>
<ul id="list-comm-developments">
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
<li>
<ul class="comm-sub-nav">
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$subLevel]/* [@isDoc and string(umbracoNaviHide) != '1']" >
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</li>
</ul>
</div>
</xsl:if>
</xsl:template>
The only issue is that ".comm-sub-nav" is not pulling through subnodes and I want them to appear underneath the correct parent node if that makes sense?
So the parent node is a doc type named "Country" and then underneath you have a doctype named "Community" - within the content section of umbraco you can create another "Community" page underneath a "Community" so what I have is a community within a community.
I need the 2nd level community to appear underneath the correct coresponding parent community node.
I hope this is specific enough - any questions I will be watching the thread.
Hi Jordy,
Something like this should get you started:
You can filter the child nodes to limit them to a particular level or by document type etc.
Dan you beauty!!! Thank you so much this works a treat!!!
is working on a reply...