Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 936 posts 2571 karma points
    Feb 20, 2014 @ 13:04
    Claushingebjerg
    0

    Using mntp with macro parameter

    I have a case, where i need to use some multi node treepickers several times on the same page, so i would like to reuse my xslt with the alias of the different pickers as a macro parameter...

    So in theory i want to do this:

    <xsl:variable name="thepicker" select="/macro/pickeralias" />
    
    <xsl:for-each select="$currentPage/$thepicker/MultiNodePicker/nodeId">
    <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" />
    <xsl:value-of select="$node/@nodeName" />
    </xsl:for-each>

    But this doenst work, because you can't inject a variable into a "node-set"...
    So how to go about this?

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Feb 20, 2014 @ 13:10
    Chriztian Steinmeier
    0

    Hi Claus,

    You can use the name() function for that:

    <xsl:for-each select="$currentPage/*[name() = $thepicker]/MultiNodePicker/nodeId">
    

    /Chriztian

  • Claushingebjerg 936 posts 2571 karma points
    Feb 20, 2014 @ 13:33
    Claushingebjerg
    0

    Heh... ehhh... thats... ehhh.... F...... AWESOME!!!!!!!!

    Could it be any simpler?!?

    Another beer for Mr. Xslteinmeier

Please Sign in or register to post replies

Write your reply to:

Draft