Display image chosen from MediaPicker v6 razor partial
Hi
I'm trying to display an image chosen with the media picker datatype in a partial razor view:
@{
var heroItems = CurrentPage.HeroItems;
}
@foreach (var item in heroItems)
{
<img src="@Umbraco.Media(item.HeroImage.Id).Url" alt="image description" width="980" height="333" />
}
My "item" dynamic does not come back with a property for "HeroImage". Other properties of different datatypes (Richtext, textstring) are coming back fine.
I've got it working now - I was clearly getting a cached version back somehow which is odd because I cleared it down in the back office, and have disabled the cache in the umbraco config.
Display image chosen from MediaPicker v6 razor partial
Hi
I'm trying to display an image chosen with the media picker datatype in a partial razor view:
My "item" dynamic does not come back with a property for "HeroImage". Other properties of different datatypes (Richtext, textstring) are coming back fine.
I've tried clearing the cache.
Any ideas what I could be doing wrong?
I've got it working now - I was clearly getting a cached version back somehow which is odd because I cleared it down in the back office, and have disabled the cache in the umbraco config.
Also my razor syntax was incorrect, it should be:
is working on a reply...