Copied to clipboard

Flag this post as spam?

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


  • Bruce Canino 21 posts 42 karma points
    Apr 09, 2011 @ 01:07
    Bruce Canino
    0

    Navagtion class for Xslt

    I am a new user to Umbraco, but I know asp.net, html and other CMS systems. I also a nub to Xslt

    I am using Umbraco 4.7.0

    What I am trying to do is add a css class to the included Umbraco Navagtion code. To the data types, I add a field call navClass and trying to refence it from the macro.

    <!-- The fun starts here -->
    <ul id="navlist">
    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
      <li>
        <a class="(string(navClass))"  href="{umbraco.library:NiceUrl(@id)}">
        </a>
      </li>
    </xsl:for-each>
    </ul>

    but looking at the page source I get

     <div id="nav">
    <ul id="navlist"><li><a class="(string(navClass))" href="/solutions.aspx" /></li><li><a class="(string(navClass))" href="/markets.aspx" /></li></ul>
      </div>
  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Apr 09, 2011 @ 01:12
    Chriztian Steinmeier
    0

    Hi Bruce,

    You use the curly braces for that - and you don't need the string() function:

    <!-- The fun starts here -->
    <ul id="navlist">
        <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li>
                <a class="{navClass}"  href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="@nodeName" />
                </a>
            </li>
        </xsl:for-each>
    </ul>

    /Chriztian

  • Bruce Canino 21 posts 42 karma points
    Apr 09, 2011 @ 01:20
    Bruce Canino
    0

    Chriztian

    DOH!

    I guess I need better glasses or a bigger monitor. I feel embarrassed now.

    Thanks for the quick reply.

     

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Apr 09, 2011 @ 01:28
    Chriztian Steinmeier
    0

    No worries, Bruce :-)

    We've all tried something like that. I mean... of course not. Never. :-)

     

    /Chriztian 

     

  • Bruce Canino 21 posts 42 karma points
    Apr 16, 2011 @ 03:41
    Bruce Canino
    0

    I got a email saying I should mark this as a solution, but I really don't see how to do this. I can click on High Five, but I can't vote because I don't have enought Karma

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 16, 2011 @ 10:57
    Jan Skovgaard
    0

    HI Bruce

    You should see an option on the posts from those who replied to, which reads something like "Mark as solution". If I remember correctly it's placed with the user avatar.

    To give a high five you need to achieve 70 karma points.

    /Jan

  • Bruce Canino 21 posts 42 karma points
    Apr 18, 2011 @ 19:37
    Bruce Canino
    1

    Jan,

    Thanks for the help, There was a green check mark which when you hover over it reads Mark as solved.

    This is now solved.

    Thanks for your help.

    Bruce

Please Sign in or register to post replies

Write your reply to:

Draft