I have an Overview template which summarizes properties from child pages (text, Vorto fields, etc.) but I cannot figure out how to access the contents of the Media Picker property of the child pages.
I iterate through the child pages with a @foreach (IPublishedContent item in newsItems) { ...} loop (I believe getting the Vorto values requires the cast to IPublishedContent)
Media Picker in Overview template U7 Razor
Hi,
I have an Overview template which summarizes properties from child pages (text, Vorto fields, etc.) but I cannot figure out how to access the contents of the Media Picker property of the child pages.
I iterate through the child pages with a @foreach (IPublishedContent item in newsItems) { ...} loop (I believe getting the Vorto values requires the cast to IPublishedContent)
I have tried an adaptation of the solution here:
http://our.umbraco.org/forum/developers/razor/46969-Displaying-Images-from-Multiple-Media-Picker
but no luck
Any help would be much appreciated!
Thanks,
Steve
Hi again,
Found a solution:
@foreach (IPublishedContent item in newsItems) {
var im = Umbraco.TypedMedia(item.GetProperty("featureImage").DataValue);
<img src="im.Url"/>
}
... but found this quite tricky. Where could I find good reference material on such things?
Thanks,
Steve
is working on a reply...