Copied to clipboard

Flag this post as spam?

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


  • Alec McCauley 1 post 21 karma points
    Jan 21, 2011 @ 16:00
    Alec McCauley
    0

    List Media Items

    Hello,

    I have created a new media type called "Banners" on our site. Basically its an image field and a text field that will get used to run a banner slideshow with captions. What I'm trying to do is write and Xslt file to retrieve all those banners and output them as HTML with an <img> tag and then the caption,. I have them all stored in one media folder but none of the code samples I have found for retrieving media items seem to work for me.

    I am using umbraco 4.

    Alternatively, is there a better way to do this?

    Thanks so much.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 21, 2011 @ 18:10
    Jan Skovgaard
    0

    Hi Alec

    First, welcome to our and the wonderfull world of Umbraco :-)

    Can you be a bit more specific on the Umbraco version you're using? Since 4 is very broad and there is a big diference on an Umbraco 4.0.x and below and 4.5.x and higher.

    Also the text for the caption is it stored on the image node or in a node in the content tree?

    When it comes to XSLT the main difference is that with the release of 4.5 the XML schema was changed. So if you're using Umbraco 4.5 and the samples you have found is for Umbraco 4.0.x then they are showing how to do it using the old schema (also reffered to as the legacy schema).

    So before we know what version of Umbraco you're using it's hard to tell you specifically what could be the problem with your XSLT code. It's also easier to help you out if you could post a snippet of the code in here.

    In the wiki there is are some good examples on how to use the GetMedia extension to fetch images from the media section and the samples show how to to it using both the old legacy schema and the new schema: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia

    Maybe the media iterator package could also be of interest to you since I think there is a XSLT file in there, which you could probably base your XSLT macro on if it does not fit you out of the box: http://our.umbraco.org/projects/website-utilities/media-iterator

    Hope this helps and inspires.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft