The Media Picker stores the ID of the image. To get the image URL you'll need to use the helper function GetMedia. It's usually best to do this from a macro (example on Lee's blog), but if you wanted you should be able to use Inline XSLT on the Item tag to achieve this:
Thanks Tom Fulton, Your solution worked great for me. This code can be pasted right into your template where you want the image to be. Just simply replace "modellbild" with the alias of your media picker and everything should work fine. This has worked for me in a number of umbraco versions, the latest I have tried being 7.2.2. Hopefully this helps someone who is struggling with a similar issue.
Display images from media picker
Hi
I have problems displaying images that i have uploaded from the media picker.
this is not working: <img src="<umbraco:Item field='modellbild' runat='server'></umbraco:Item>" alt=""/>
I tired this but it's not working: http://forum.umbraco.org/yaf_postst6956_Using-the-media-picker-and-uploader-to-add-images.aspx
where do i get the imgAlias casuse the id isn't working
Hi,
The Media Picker stores the ID of the image. To get the image URL you'll need to use the helper function GetMedia. It's usually best to do this from a macro (example on Lee's blog), but if you wanted you should be able to use Inline XSLT on the Item tag to achieve this:
<img src='<umbraco:Item field="modellbild" runat="server" Xslt="umbraco.library:GetMedia({0},false())/umbracoFile"></umbraco:Item>' alt=''/>
Hope this helps,
Tom
If you want to store all the data of a media item you should try the Digibiz Advanced Media Picker.
Jeroen
Hi..
Much similar Toms suggestion, I often use this to display an image selected from the Media Picker:
Bjarne
The Razor way
Thank you all guys, now it's working.
Tom Fulton asware is the first right one.
Since this thread showed up on a Google search I figured I'd add a solution for Umbraco 6. Might work in 4.x also, and probably does work in 7.x.
Thanks Tom Fulton, Your solution worked great for me. This code can be pasted right into your template where you want the image to be. Just simply replace "modellbild" with the alias of your media picker and everything should work fine. This has worked for me in a number of umbraco versions, the latest I have tried being 7.2.2. Hopefully this helps someone who is struggling with a similar issue.
<img src='<umbraco:Item field="modellbild" runat="server" Xslt="umbraco.library:GetMedia({0},false())/umbracoFile"></umbraco:Item>' alt=''/>
is working on a reply...