Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 939 posts 2574 karma points
    Sep 23, 2010 @ 14:50
    Claushingebjerg
    0

    getting media items from ucompontents multi node tree picker

    I have a problem getting media items returned from the multi tree picker

    I have the following xslt, pretty much copied from the example from codeplex

    <xsl:template match="/">
     <xsl:if test="$currentPage/toppic/MultiNodePicker/nodeId">
      <ul>
       <xsl:for-each select="$currentPage/toppic/MultiNodePicker/nodeId">
        <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" />
        <li>
         <a href="{umbraco.library:NiceUrl(.)}">
          here comes the link <xsl:value-of select="$node/@nodeName" />
         </a>
        </li>
       </xsl:for-each>
      </ul>
     </xsl:if>
    </xsl:template> 

    It correctly iterates and returns the correct number of nodes, but not the id of them...

    <ul>
     <li><a href="#">here comes the link </a></li>
     <li><a href="#">here comes the link </a></li>
     <li><a href="#">here comes the link </a></li>
    </ul>

    Version is 1.0 downloaded from codeplex

    Datatype is set up to use media, XPath match type set to "disable", No Xpath filter set, maximum nodes -1, Data as XML...

    Any ideas why this doesnt work?

  • Claushingebjerg 939 posts 2574 karma points
    Sep 23, 2010 @ 15:03
    Claushingebjerg
    0

    if i change

    <xsl:value-of select="$node/@nodeName" />

    to

    <xsl:value-of select="$node" />

    i get the following return

    <ul>
    <li><a href="#">No published item exist with id 1075</a></li>
    <li><a href="#">No published item exist with id 1086</a></li>
    <li><a href="#">No published item exist with id 1085</a></li>
    </ul>

    Which is strange, since those are the image id's in the media sction ?!?!?!

  • Claushingebjerg 939 posts 2574 karma points
    Sep 30, 2010 @ 15:06
    Claushingebjerg
    0

    Ok solved it.

    i need to use umbraco.library:GetMedia

     <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)/teaserBillede" />
     <xsl:variable name="picfile" select="umbraco.library:GetMedia($node, false())/umbracoFile" />
Please Sign in or register to post replies

Write your reply to:

Draft