Can't get (legacy) media picker to be displayed with nested content
Hi all,
I'm working on a website with Umbraco 7.5.4., which I didn't build but need to make some changes.
I have nested content and I'm trying to display this. I get the title displayed correctly, but not my images.
The code I'm using is as followed:
@foreach (var item in selection) {
<p>@item.Name</p>
var subItems = item.GetPropertyValue<IEnumerable<IPublishedContent>>("hoofdstuk");
if (subItems != null) {
foreach (var subItem in subItems) {
if (subItem != null) {
<p><strong>@Umbraco.Field(subItem, "nummer")</strong> @Umbraco.Field(subItem, "titel")</p>
var file = Umbraco.Media(subItem.bestand);
if (file != null) {
<a href="@file.Url">Link</a>
}
}
}
}
}
I got the following error: 'Umbraco.Web.Models.PublishedContentBase' does not contain a definition for 'bestand'
For the content in my <p> tag I solved it by using @Umbraco.Field but how to solve this for the Media Picker?
I noticed the Media Picker used is the Legacy Media Picker with the alias Umbraco.MediaPicker.
I don't have the possibility to upgrade this version of Umbraco.
Can't get (legacy) media picker to be displayed with nested content
Hi all,
I'm working on a website with Umbraco 7.5.4., which I didn't build but need to make some changes. I have nested content and I'm trying to display this. I get the title displayed correctly, but not my images.
The code I'm using is as followed:
I got the following error:
'Umbraco.Web.Models.PublishedContentBase' does not contain a definition for 'bestand'
For the content in my<p>
tag I solved it by using@Umbraco.Field
but how to solve this for the Media Picker?I noticed the Media Picker used is the Legacy Media Picker with the alias
Umbraco.MediaPicker
.I don't have the possibility to upgrade this version of Umbraco.
I hope someone can help me out.
I was able to fix it with:
is working on a reply...