Copied to clipboard

Flag this post as spam?

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


  • aradhya 11 posts 30 karma points
    Jun 04, 2010 @ 09:32
    aradhya
    0

    Accessing all the images from media folder.

    Hi,

    Hi have around 50 images in side media folder (media/pictures).

    In xslt i want to access all the 50 images and display the image.  How can I loop through the images in the folder?

     

    Thanks,

    aradhya

  • dandrayne 1138 posts 2262 karma points
    Jun 04, 2010 @ 10:45
    dandrayne
    0

    Hi Aradhya

    You need to use the GetMedia library function, and pass true() as the second parameter to recursively get the media under the media node you have requested.

    E.g. if 1542 was the id of your media folder (or the output of a mediapicker)

    <xsl:variable name="mediaItems" select="umbraco.library:GetMedia(1542, true())"/>
    <xsl:for-each select="$mediaItems/node">

    <img src="{current()/data[@alias='umbracoFile']}" />

    </xsl:for-each>

    Hope this helps,
    Dan

Please Sign in or register to post replies

Write your reply to:

Draft