Secondary Navigation, display children, if none get sibilings, unless in level 1?
I want this to display the currentpage's children, if it doesn't have any children then it needs to display the sibilings of the currentpage. Unless those sibilings are at root level. Here is my code, please let me know what I need to do. Thanks
Secondary Navigation, display children, if none get sibilings, unless in level 1?
I want this to display the currentpage's children, if it doesn't have any children then it needs to display the sibilings of the currentpage. Unless those sibilings are at root level. Here is my code, please let me know what I need to do. Thanks
<xsl:if test="count($currentPage/child::node [string(data [@alias='umbracoNaviHide']) != '1']) > '0'">
<ul>
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1'][string(./data [@alias='linkHide']) !='1']">
<li>
<xsl:choose>
<xsl:when test="data [@alias='linkText'] != ''">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="data [@alias='linkText']" />
</a>
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:if>
<xsl:if test="count($currentPage/child::node [string(data [@alias='umbracoNaviHide']) != '1']) = '0'">
<ul>
<xsl:for-each select="$currentPage/parent::node/node [string(./data [@alias='umbracoNaviHide']) != '1'][string(./data [@alias='linkHide']) !='1']">
<li>
<xsl:choose>
<xsl:when test="data [@alias='linkText'] != ''">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="data [@alias='linkText']" />
</a>
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:if>
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion