First bit of Razor, well apart from the Level 1 snippet the other day! I'm trying to display an image from a property on a template. The image comes from a Terabyte Image Cropper on the Document Type. So far I have tried:
- umbraco version: implementation may have changed from v4.7 to v4.7.1
- stored value for a terabyte image cropper
So, tell us what version of umbraco you're using and secondly, try to find out how data is stored for such a property (Check /App_Data/umbraco.config file). Based on that info, we might find a solution that fits your environment.
Ok, so the terabyte image cropper is actually used on a document type, right? in that case, you could just output
<img src="@Model.boBPageVenueFullImage" />
If it's used on a doc type, only data saved is the full path to the image file, so you won't be able to get a display friendly name for the image.
(Just realising that the datatype can only be used on doc types, so regardless of the version v4.7 or v4.7.1, implementation remains identical - was a bit confused by your @Model.Media...)
Display Single Image from Property
Hi all,
First bit of Razor, well apart from the Level 1 snippet the other day! I'm trying to display an image from a property on a template. The image comes from a Terabyte Image Cropper on the Document Type. So far I have tried:
<umbraco:Macro runat="server" language="cshtml">
<img src='@Model.Media("boBFullSizeImageForProfile", "umbracoFile")' alt='@Model.GetProperty("fullName")' />
</umbraco:Macro>
Obviously it's not working, or I wouldn't be posting!
Darryl,
there's two things to keep an eye on:
- umbraco version: implementation may have changed from v4.7 to v4.7.1
- stored value for a terabyte image cropper
So, tell us what version of umbraco you're using and secondly, try to find out how data is stored for such a property (Check /App_Data/umbraco.config file). Based on that info, we might find a solution that fits your environment.
Cheers,
/Dirk
Thanks for your reply Dirk, here's the info you requested:
and the Umbraco version is 4.7.0.
Thanks.
Ok, so the terabyte image cropper is actually used on a document type, right? in that case, you could just output
If it's used on a doc type, only data saved is the full path to the image file, so you won't be able to get a display friendly name for the image.
(Just realising that the datatype can only be used on doc types, so regardless of the version v4.7 or v4.7.1, implementation remains identical - was a bit confused by your @Model.Media...)
Cheers,
/Dirk
Thanks Dirk!
is working on a reply...