I'm using Umbraco 4.0 and I'm making a change to an image gallery. Previously I used the "Upload" datatype on my "imageNode" to upload an image to my imageNode within the Content section. Now I've changed it to the "Media Picker" datatype to pick images from the Media section. However I'm struggling with getting the media picker image to display.
So just to confirm (for others who view this post)... The change you needed to make was to was to change this:- <xsl:value-of select="$imageNode/data [@alias='umbracoFile']" />
How to update from Upload to Media picker?
I'm using Umbraco 4.0 and I'm making a change to an image gallery. Previously I used the "Upload" datatype on my "imageNode" to upload an image to my imageNode within the Content section. Now I've changed it to the "Media Picker" datatype to pick images from the Media section. However I'm struggling with getting the media picker image to display.
Here's my code:
This works for my "upload" datatype
This doesn't work for my "media picker" datatype. I also want it to concat the '_thumb_142.jpg'
Can anyone help me with this issue?
Cheers,
JV
Here's my entire XSLT code:
Took a bit of time but I figured it out:
So just to confirm (for others who view this post)... The change you needed to make was to was to change this:-
<xsl:value-of select="$imageNode/data [@alias='umbracoFile']" />
to this:-
<xsl:variable name="mediaId" select="number($imageNode/data[@alias='imageGalleryPhoto'])" />
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
<xsl:value-of select="$mediaNode/data[@alias='umbracoFile']">
to make your new MediaPicker field 'imageGalleryPhoto' work.
is working on a reply...