Copied to clipboard

Flag this post as spam?

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


  • Thorsten Hoffmann 48 posts 119 karma points
    Feb 25, 2010 @ 11:58
    Thorsten Hoffmann
    0

    Extending Navigation with Root Node

    Hello,

    I have a new website and use the navigation-xslt of the runway package. Now I want to integrate my root node ("Home") into this nagivation.

    So I manually put my "Home"-Site into this xslt. Now I want to check, if this root node is actually selected and then add a new style via <xsl:attribute>.

    How can I check in the xslt if the current site is the rood node or "Home"-Site ?

    Thanks,

    Thorsten 

     

     

  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 12:06
    Chris Gaskell
    0

    Thorsten

    You could check as the below:

    <!-- if the current page is the root node (as in homepage) - use the current node -->
    <xsl:when test="$currentPage/@level = 1">
        <xsl:copy-of select="$currentPage" />
    </xsl:when>

     

    Hope that helps.

     

    Chris.

     

  • Thorsten Hoffmann 48 posts 119 karma points
    Feb 25, 2010 @ 12:24
    Thorsten Hoffmann
    0

    Hi Chris,

    thanks for your post, but it doesn't really solved my problem.

    Here is my code:

    <li>
    <a href="/">
    <!-- Here i want to check if the current site the root node -->   
    <!-- and if yes add the following xsl-attribute -->
    <xsl:attribute name="style">color:yellow;</xsl:attribute>
    Willkommen
    </a>
    </li>

    If want to check, if the current site is the root-site and if yes, add a xsl-attribute.

    Base of my navigation is the runwaytopnavigation.xslt from the runway package.

    Thanks,

    Thorsten

  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 12:48
    Chris Gaskell
    0

    Thorsten

    Try this:

    <li>
    <a href="/">

    <xsl:if test="$currentPage/@level = 1">
    <xsl:attribute name="style">color:yellow;</xsl:attribute>
    </xsl:if>

    Willkommen
    </a>
    </li>

     

    Thanks
    Chris.

  • Thorsten Hoffmann 48 posts 119 karma points
    Feb 25, 2010 @ 17:17
    Thorsten Hoffmann
    0

    That was my solution !

    Thank You Chris,


    Thorsten

  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 17:27
    Chris Gaskell
    0

    Thorsten, no problem. Happy Umbracoing.

     

    Chris.

  • 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.

Please Sign in or register to post replies