Copied to clipboard

Flag this post as spam?

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


  • Kim Grandgagnage 63 posts 87 karma points
    Jun 27, 2011 @ 10:17
    Kim Grandgagnage
    0

    Loop through nodes of multinodepicker (uComponents)

    I've created a datatype based on the multi-node tree picker of uComponents. Maximum node selections is set on -1. Data is returned as XML. My field had an alias "home_reistypesSelectie".

    I want to loop through these nodes in my xslt macro, but for some reason it won't work.

    My code is:

     <xsl:for-each select="$currentPage/home_reistypesSelectie/multinodepicker/nodeid">    
      <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" />
        <xsl:value-of select="$node/@nodeName" />
     </xsl:for-each>

    The following code:

    <xsl:copy-of select="$currentPage/home_reistypesSelectie"/>

    returns:

    <home_reistypesselectie><multinodepicker><nodeid>1421</nodeid><nodeid>1410</nodeid><nodeid>1437</nodeid></multinodepicker></home_reistypesselectie>

    What am I doing wrong?

  • Rich Green 2246 posts 4008 karma points
    Jun 27, 2011 @ 10:25
    Rich Green
    1

    Hey Kim,

    I think your casing is wrong (MultiNodePicker/nodeId), change your code to this:

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

    Rich

  • Kim Grandgagnage 63 posts 87 karma points
    Jun 27, 2011 @ 10:27
    Kim Grandgagnage
    0

    Great! Thanks! That solved the problem :)

Please Sign in or register to post replies

Write your reply to:

Draft