Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

Rendering nested content within another nested content

$
0
0

Hi. Im working on an Umbraco 8.3 project where I need to add a Nested Content data type inside another Nested Content.

I've done a lot of googling and I can only find examples for older Umbraco versions which don't seem to work in Umbraco 8.

Here is the code i've got so far,

@if (Model.HasValue("pageSections"))
{
    var items = Model.Value<IEnumerable<IPublishedElement>>("pageSections");
    foreach(var item in items)
    {
        <h1>First level</h1>
        <div>
            @{
                var secondItems = item.GetProperty("group").Value();
                if(secondItems  != null) {
                    foreach(var secondItem in secondItems){
                        <p>Second level</p>
                    }
                }
            }
        </div>
    }
}

Would be great if anyone has any ideas on what i'm doing wrong.

Im not a developer so apologies if this is a silly question!

Thanks!


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>