Copied to clipboard

Flag this post as spam?

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


  • lingjing 28 posts 45 karma points
    Aug 09, 2010 @ 01:14
    lingjing
    0

    Problem with top navigation

    hi All. I am using Umbraco 4.5.1. My site structure is like below:

    Content

      -- Home

     -- About Us

        --- some sub pages

     -- Contact Us 

      -- etc

    And I used default nagivation xslt template for my site. like:

      <xsl:variable name="level" select="1"/>

      <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">

     However the navigation never shows if I add " [@isDoc and @level=$level]". Could anyone let me know how to fix it?

    Thanks 

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Aug 09, 2010 @ 01:30
    Chriztian Steinmeier
    0

    Hi lingjing,

    The expression in the for-each statement asks for children of the level 1 nodes, but based on your content, you actually want the level 1 nodes, so do like this:

    <!-- Grab the content root -->
    <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::root" />
    
    <xsl:for-each select="$siteRoot/*[@isDoc][not(umbracoNaviHide = 1)]">
        ...
    </xsl:for-each>

    This way, you can just reassign the siteRoot variable if you add another level in the Content section.

    /Chriztian

  • lingjing 28 posts 45 karma points
    Aug 09, 2010 @ 03:06
    lingjing
    0

    Thanks Chrizian

Please Sign in or register to post replies

Write your reply to:

Draft