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.
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
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.
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
is working on a reply...