Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lisa Duvall 3 posts 23 karma points
    Mar 15, 2011 @ 20:31
    Lisa Duvall
    0

    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']) &gt; '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>


Please Sign in or register to post replies

Write your reply to:

Draft