Copied to clipboard

Flag this post as spam?

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


  • Mihai Busuioc 5 posts 25 karma points
    Feb 02, 2012 @ 15:26
    Mihai Busuioc
    0

    uComponents - Multi-node tree picker for a MediaType cannot access xml data

    Hello,

    I want to create some 'virtual' folder inside media to allow me to chose images i want to show them.

    This is what i have done:

    I create a data tape 'Virtual image picker' based on (uComponents - MNTP)

    I create a Media Type 'Virtual' based on 'Virtual image picker' (images as property). This allow me to choose (group) images form Media.

    Second i cread a data type 'virtual folder picker' based on (Ultipate picker)

    This 'virtual folder picker' is used in a content item to chose a 'virtual' folder (startVirtual) as property

    After i create the media structure and set a node to 'Virtual folder picker' i wanted to render the images.

    Here i cannot have access to xml data. What i got is the id's like the 123414561345 (3 images 1234, 1456, 1345) this is for  <xsl:for-each select="umbraco.library:GetMedia($virtualfolderid,0)"/> or <xsl:for-each select="umbraco.library:GetMedia($virtualfolderid,0)/images"/>

    if i'm trying something like <xsl:for-each select="umbraco.library:GetMedia($virtualfolderid,0)/images/MultiNodePicker/nodeId"/> i got xslt error.

    <xsl:for-each select="$currrentPage/ccc/multiNodePicker/nodeId"/> works fine is uComponets-MNTP is used in 'content' part of umbraco.

    If anyone have any idea please replay.

    Thank you

     

     

     

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 02, 2012 @ 15:41
    Tom Fulton
    0

    Hi,

    I'm a little confused on your solution, but I think you need something like this:

    <xsl:if test="$virtualfolderid &gt; 0"> <!-- without this you'll get an XSLT error since GetMedia needs to have an int passed (it does a test when you click save) -->
      <xsl:for-each select="umbraco.library:GetMedia($virtualfolderid,false())/images/MultiNodePicker/nodeId"/>
        <xsl:variable name="mediaNodeId" select="." /> <!-- store the media node id selected in MNTP as a variable -->
        <xsl:if test="$mediaNodeId &gt; 0">
          <xsl:variable name="mediaNodeXml" select="umbraco.library:GetMedia(., false())" /> <!-- grab the media item content -->
          <xsl:if test="not($mediaNodeXml)/error"> <!-- just making sure the media still exists -->
            <img src="{$mediaNodeXml/umbracoFile}" />
          </xsl:if>
        </xsl:if>
      </xsl:for-each>
    </xsl:if>

    Also check out DAMP as an alternative to MNTP for Media, it might help you out...though not sure it can be used on Media Items (not sure you'd need to though)

    HTH,
    Tom

  • Mihai Busuioc 5 posts 25 karma points
    Feb 02, 2012 @ 15:55
    Mihai Busuioc
    0

    Thanks Tom,

    i was suprized that your solution was 95% like my....only a later .../nodeID was different but significantly.

    Thanks ;)

     

Please Sign in or register to post replies

Write your reply to:

Draft