Copied to clipboard

Flag this post as spam?

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


  • Fredrik Esseen 594 posts 830 karma points
    Apr 07, 2009 @ 13:01
    Fredrik Esseen
    0

    xsl:if

    Hi!

    Im totally green at xslt but wanna do something like this:

    Im using the RunwayTopNavigation as menu and now I want to switch cssclass on the menuitem(li) if the user is on that page.

    How do I do that in xslt?

    example:

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    Apr 07, 2009 @ 13:04
    Ismail Mayat
    0

    [code]









    [/code]

    regards

    Ismail

  • Fredrik Esseen 594 posts 830 karma points
    Apr 07, 2009 @ 13:40
    Fredrik Esseen
    0

    Thanks!

    Is there an easy way to get which node (count) the current node in the foreach is?

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Apr 07, 2009 @ 13:43
    Dirk De Grave
    0

    Hi,

    Position of the node in the for each loop is determined by the position() function.
    It can be compared against first() and last() position for example.

    Hope this helps.

    Regards,
    /Dirk

  • Fredrik Esseen 594 posts 830 karma points
    Apr 07, 2009 @ 13:45
    Fredrik Esseen
    0

    Can you please show me some syntax..?

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Apr 07, 2009 @ 13:48
    Dirk De Grave
    0

    Sure I can,

    [code][/code]

    last() works in a similar way, but checks whether node is last in for-each loop.

    Regards,
    /Dirk

  • Fredrik Esseen 594 posts 830 karma points
    Apr 07, 2009 @ 13:54
    Fredrik Esseen
    0

    Thank you! That helped!

  • 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