Copied to clipboard

Flag this post as spam?

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


  • Laura Holland 82 posts 103 karma points
    Jan 11, 2011 @ 18:49
    Laura Holland
    0

    Multi-Node Tree Picker: XSLT for displaying images from Media?

    I'm having trouble working out the correct XSLT syntax for my multi-node tree picker macro. I'm trying to display the images that have been selected. Here's what I've got, tweaked from the codeplex example (it's not working):

    <xsl:template match="/">
     
      <xsl:if test="$currentPage/subpageImages/MultiNodePicker/nodeId">

              <!-- Loop through each of the nodeId values -->
          <xsl:for-each select="$currentPage/subpageImages/MultiNodePicker/nodeId">

                  <xsl:variable name="node" select="umbraco.library:GetMedia(.)" />
            <img src="{$node/umbracoFile}" alt="[image]" height="{$node/umbracoHeight}" width="{$node/umbracoWidth}" />

          </xsl:for-each>

          <br /><br />

      </xsl:if>
      
    </xsl:template>

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 11, 2011 @ 19:34
    Kim Andersen
    1

    Hi Laura.

    I think you might just need to change a small thing in the GetMedia extension.

    Try changing the node-variable to this:

    <xsl:variable name="node" select="umbraco.library:GetMedia(.,0)" />

    I can't quite remember the returned XML from the MultiNodePicker, but I think this will help you out.

    /Kim A

  • Laura Holland 82 posts 103 karma points
    Jan 11, 2011 @ 19:41
    Laura Holland
    0

    Thanks so much! It works perfectly now.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 11, 2011 @ 20:19
    Kim Andersen
    0

    I'm glad to hear.

    Couldn't quite remember how the returned XML looked like, so I just set up a small example after answering you to doublecheck that there wasn't anything wrong with the selection you made in the code :)

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft