I have set up a Blockgrid view for navigation that has the ability to add multiple navigation items - each of these nav items can also have multiple children (which are currently setup as a Blocklist editor)
I can't get the children to render - I keep getting errors with this:
var rowChild = (NavLinkItem)item.Content;
if(rowChild.ChildItems == null || !rowChild.ChildItems.Any()) return;
foreach(var item in rowChild.ChildItems)
{
var rowChildItem = (EventDate)item.Content;
<!--Should display child items here but keep getting breaking error here-->
}
I'm actually a designer / front-end guy, so not so very knowledgeable with C#.
What am I doing wrong? Any help for a noob would be much appreciated :)
Umbraco 11 nesting Blockgrid inside Blockgrid
I have set up a Blockgrid view for navigation that has the ability to add multiple navigation items - each of these nav items can also have multiple children (which are currently setup as a Blocklist editor)
I can't get the children to render - I keep getting errors with this:
I'm actually a designer / front-end guy, so not so very knowledgeable with C#.
What am I doing wrong? Any help for a noob would be much appreciated :)
Here is my full code:
Hi DChad,
What is the error you are getting?
Here's the error I get:
Hi,
This is because you have re-used the local parameter item, just rename one of them :)
rename the nested on to something else, for example
Ah okay - that did it. I can't believe I didn't spot that. I just thought I was missing something bigger. Many thanks!
It's working now.
No problem, we all get code blindness now and again :D
is working on a reply...