Copied to clipboard

Flag this post as spam?

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


  • bev0 39 posts 59 karma points
    Jul 01, 2011 @ 16:07
    bev0
    0

    return GetMedia nodes list without provide a nodeid

    is it possible to return a list of nodes (in xml form) WITHOUT provide a node id ?

    normal: umbraco.library:GetMedia($nodeid, 'false')/Image[@nodeName=$someimage/value[1]]/umbracoFile

    but i want to do a quick <xsl:copy-of select="umbraco.library:GetMedia(something_goes_here, 'false')"/> to return a list of nodes and subnodes.  basically i want to refer by Media nodename instead of nodeid.  is anything of this possible, if so please help.

    thanks in advance !

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 01, 2011 @ 16:33
    Dirk De Grave
    0

    Check out uQuery which is part of uComponents

     

    Cheers,

    /Dirk

  • Richard 146 posts 168 karma points
    Jul 04, 2011 @ 12:55
    Richard
    0

    umbraco.library:GetMedia needs to be given a node ID to return the media item/items. But you can give it an ID that is a folder (node that contains a collection of images or files). So I have done the following, to list items within a media folder.

    <xsl:variable name="mediaItems" select="umbraco.library:GetMedia($mediaFolder, 'true')"/>

    <xsl:apply-templates select="$mediaItems/Image" >
    <xsl:sort select="@sortOrder" order="ascending"/>
    </xsl:apply-templates>


    You could then check the result for a media item that has a certain name.

Please Sign in or register to post replies

Write your reply to:

Draft