Copied to clipboard

Flag this post as spam?

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


  • David F. Hill 122 posts 242 karma points
    Jan 11, 2011 @ 00:08
    David F. Hill
    0

    Property alias as parameter (4.5.2, new schema)

    Hello Umbraco Colleagues,

    Can't figure out this simple thing in the new schema: I need pass the property alias as a parameter and get its value.

    This returns the property alias name, not its value (property is the parameter that represents the property alias)

    <ul>
      <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">
      <li>
        <xsl:value-of select="$property" />
      </li>  
    </xsl:for-each>
    </ul>

    Thanks for the help.

    David

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jan 11, 2011 @ 00:14
    Chriztian Steinmeier
    1

    Hi David,

    You use the local-name() or name() functions for this:

    <xsl:value-of select="*[name() = $property]" />

    (name() is shorter and safe to use in Umbraco, so go with that - local-name() is used when using namespaces and gives the name without the prefix) 

    /Chriztian

  • Kim Andersen 1447 posts 2197 karma points MVP
    Jan 11, 2011 @ 00:18
    Kim Andersen
    1

    Hi David.

    Try this one:

    <xsl:value-of select="*[name()=$property]" />

     

    UPDATE after posting my answer: Damn you're fast Chriztian. Or maybe I'm just too slow :)

     

    /Kim A

  • David F. Hill 122 posts 242 karma points
    Jan 11, 2011 @ 00:24
    David F. Hill
    0

    Hi Chriztian, Hi Kim,

    Thanks to you both - works as advertised.

    David

  • 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