Does your code for retrieving "backImage" return anything? I can't quite tell from the image whether you're in a partial or in a template with the model where this image is located.
Once you've got the field, depending on your version of Umbraco and whether Property Value Converters are enabled you may need to convert the Media id to a media object and then get it's URL.
@{
var backgroundUrl = String.Empty;
var backgroundImage = Umbraco.TypedMedia(Model.Content.GetPropertyValue<int>("backImage"));
if (backgroundImage != null)
{
backgroundUrl = backgroundImage.Url;
}
}
Image picker
I tried to get the page background image using media picker. I use the below code. but it does not work. Is there any other code to it?![enter image description here](/media/upload/74a55249-9bc6-46d3-a17a-1cefa16ce6f1/1%281%29.png)
Hi,
Does your code for retrieving "backImage" return anything? I can't quite tell from the image whether you're in a partial or in a template with the model where this image is located.
Once you've got the field, depending on your version of Umbraco and whether Property Value Converters are enabled you may need to convert the Media id to a media object and then get it's URL.
is working on a reply...