umbraco nested content
//Umbraco 8+
@{
var items = Model.Value<IEnumerable<IPublishedElement>>("myPropertyAlias");
foreach(var item in items)
{
// Render your content, e.g. item.Value<string>("heading")
}
}
4
10
//Umbraco 7
@{
var items = Model.GetPropertyValue<IEnumerable<IPublishedContent>>("myPropertyAlias");
foreach(var item in items)
{
// Render your content, e.g. item.GetPropertyValue<string>("heading")
}
}
Thank you!
10
0
Are there any code examples left?
New code examples in category Other