How can I display a Media picker image
Asked Answered
C

2

3

Sorry this might be a newbie question but I am quite new to Umbraco.

I have a media picker set up on a document type, and it all works fine. So I go to the template and enter

 @Umbraco.Field("bottomRightLarge")

this only gives me the ID of the image, how can I get this to show the actual image the user has selected? I am using UMBRACO 7 - and I have tried http://our.umbraco.org/projects/website-utilities/social-bookmarking-button/general-discussions/19360-Displaying-an-image-from-Media-Picker-in-a-web-page - but the XSLT ERRORS bug time.

Chondriosome answered 12/2, 2014 at 15:29 Comment(0)
C
2

This worked for me

<umbraco:Macro runat="server" language="cshtml">
<img src="@Model.MediaById(Model.topleftsmall).umbracoFile" alt=""/>
</umbraco:Macro>

please note I was trying this on firefox 20.0.1, and the save just didnt work properly.

Chondriosome answered 14/2, 2014 at 9:51 Comment(0)
C
6

Try using the umbraco image item if using webforms or umbraco media for mvc

<img src="@Umbraco.Media(model.articleImageOne).Url" alt="">

or

<umbraco:Image field="articleImageOne" runat="server" />
Christoperchristoph answered 5/1, 2015 at 20:0 Comment(0)
C
2

This worked for me

<umbraco:Macro runat="server" language="cshtml">
<img src="@Model.MediaById(Model.topleftsmall).umbracoFile" alt=""/>
</umbraco:Macro>

please note I was trying this on firefox 20.0.1, and the save just didnt work properly.

Chondriosome answered 14/2, 2014 at 9:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.