hi, I've been working with another cms for a couple of years now and recently started testing out umbraco. so far I discovered I'm pretty ignorant when it comes to XSLT so that's definetly a study point for me. the problem I'm currently having Is I can't seem to get to the data entered with a 'media picker' or a 'multiple media picker' I'm using the following code to test it:
<xsl:value-of select="data [@alias = 'image']"/>
the code above should display some data entered with a media picker... or so I thought.
some extra facts: - the media picker in de document type has the name and alias 'image' and has 1 image chosen. - the multiple media picker in the document type has the name and alias multi_img and has several images selected. - I can retrieve the value of other document type fields, but getiing info media files don't seem to work. - I use the following code in my template to retrieve the image from de media picker without problems:
If you have a media picker where you pick a folder instead of an image and you want all the images in this folder, then just set the second parameter for the getmedia method to 1 instead of 0.
Like this: <xsl:variable name="imageset" select="umbraco.library:GetMedia([mediaid], 1)" />
Now your variable 'imageset' will contain all the images in the selected folder.
XSLT: media picker data
hi, I've been working with another cms for a couple of years now and recently started testing out umbraco.
so far I discovered I'm pretty ignorant when it comes to XSLT so that's definetly a study point for me.
the problem I'm currently having Is I can't seem to get to the data entered with a 'media picker' or a 'multiple media picker'
I'm using the following code to test it:
the code above should display some data entered with a media picker... or so I thought.
the code above is what I'm using to test if media files have been selected with a multiple media picker.
I never seem to get past that test. I copied the code from the following page hoping to resolve this but it failed.
http://umbraco.org/documentation/books/diary-of-a-newbody/rendering-the-output
some extra facts:
- the media picker in de document type has the name and alias 'image' and has 1 image chosen.
- the multiple media picker in the document type has the name and alias multi_img and has several images selected.
- I can retrieve the value of other document type fields, but getiing info media files don't seem to work.
- I use the following code in my template to retrieve the image from de media picker without problems:
please forgive me if this question has been asked a thousand times (I did search the forum for some clues without success).
any help will be greatly apreciated.
Ruben
Hi Ruben
This blog post from Lee Keheller shows how to use a mediapicker in a bulletproof way http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/
Hope this helps,
Dan
Haven't had much time to look at it, but it does look very promising, thanks!
And there's also some info at the wiki:
http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
dandrayne. Lee's post does NOT show the mediapicker it shows how to use GETMEDIA for a single image
Not how to iterate through all the images represented by the media picker.
Does anyone know how to do this?
If you have a media picker where you pick a folder instead of an image and you want all the images in this folder, then just set the second parameter for the getmedia method to 1 instead of 0.
Like this:
<xsl:variable name="imageset" select="umbraco.library:GetMedia([mediaid], 1)" />
Now your variable 'imageset' will contain all the images in the selected folder.
is working on a reply...