Answers for "umbraco nested content"

1

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")
    }
}
Posted by: Guest on November-24-2020
1

umbraco nested content

//Umbraco 7
@{
    var items = Model.GetPropertyValue<IEnumerable<IPublishedContent>>("myPropertyAlias");

    foreach(var item in items)
    {
        // Render your content, e.g. item.GetPropertyValue<string>("heading")
    }
}
Posted by: Guest on November-24-2020

Browse Popular Code Answers by Language