Copied to clipboard

Flag this post as spam?

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


  • Peng 41 posts 62 karma points
    Jun 30, 2010 @ 10:39
    Peng
    0

    How to check if the nodeTypeAlias has some value

    Hi guys,

    I tried to find out how to check  nodetypeAlias has some value in umbraco 4.5 xslt file

    The old syntax: <xsl:when test="$currentPage/@nodeTypeAlias='SomeValue'">

    Regards,

    Peng

     

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jun 30, 2010 @ 10:49
    Chriztian Steinmeier
    2

    Hi Peng,

    You can use the selff:: axis to do this:

    <xsl:when test="$currentPage/self::SomeValue">
       <!-- do stuff -->
    </xsl:when>

    Note that you use the name without quotes for this!

    /Chriztian

  • Peng 41 posts 62 karma points
    Jul 01, 2010 @ 10:41
    Peng
    0

    Hi Chriztian.

     It works.

    Many many thanks,

    Peng

     

  • Mattias 52 posts 75 karma points
    Jul 08, 2010 @ 13:10
    Mattias
    0

    What about when you want all pages (for-each) but not of some spcific types eg:

    <xsl:for-each select="$ref/child::* [@isDoc and @nodeTypeAlias != 'SomeValue']">
  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 08, 2010 @ 13:18
    Lee Kelleher
    0

    You could use the 'name()' function, like this...

    <xsl:for-each select="$currentPage/*[@isDoc and name() != 'SomeValue']">

    Cheers, Lee.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Jul 08, 2010 @ 13:40
    Chriztian Steinmeier
    4

    I'd use the self:: axis once again:

    <xsl:for-each select="$ref/*[@isDoc and not(self::SomeValue)]" />

    I'd only use the name() function if SomeValue was a value in a variable (or referenced from somewhere else).

    /Chriztian

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 08, 2010 @ 13:41
    Lee Kelleher
    0

    Chriztian - you are good - XSLT Hero!

  • Mattias 52 posts 75 karma points
    Jul 08, 2010 @ 14:22
    Mattias
    0

    Thought something like that should be possible but wasen't sure about how to write it, i'm not a XSLT ninja like u guyz :p

Please Sign in or register to post replies

Write your reply to:

Draft