Copied to clipboard

Flag this post as spam?

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


  • Johan 188 posts 380 karma points
    Sep 28, 2011 @ 15:43
    Johan
    0

    If all descendent pages are hidden

    The script still renders an empty sub navigation list. I solved it by adding this test:

    string(count(descendant::umbracoNaviHide[text() = '0'])) != '0'

    To this statement:

    <!-- if it's a branch recurse through it's children-->
    <xsl:if test="((($isBranch = 1 and $recurse = 1) or
    ($walkChildren = 1 and $pseudoCurrentPage/descendant-or-self::*[@isDoc]
    [@id = $currentNodeID]/child::*[@isDoc])) and
    $maxMenuDepth &gt; $calculatedMenuDepth)">

    I'm sure there is a better way to solve it. XSLT is not my strongest card. Just a heads up.

  • Johan 188 posts 380 karma points
    Sep 28, 2011 @ 16:46
    Johan
    0

    Added the test to this block to:

    <!--Is the node a branch? i.e. are there children and is it in the colletion of ancestor nodes -->
    <xsl:variable name="isBranch">
    <xsl:choose>
    <xsl:when test="$currentPage/ancestor-or-self::*[@isDoc][@id = $currentNodeID]/child::*[@isDoc]">1</xsl:when>
    </xsl:choose>
    </xsl:variable>
Please Sign in or register to post replies

Write your reply to:

Draft