Is it possible to render a blocklist inside of another block list?
Good afternoon everyone, I'm trying to see if I can render a nested blocklist inside of another. I am able to this with a blocklist that contains a single type of block. I would like to do this with a blocklist that contains multiple types of blocks.
For example I'm working on a block that will have two sections a content column for my blocklist and an aside column for a grid editor so I can utilize macros in my aside (sub nav, etc..).
I'm unable to get the nested blocklist to render at all.
Yes, it is possible to do this. IIRC, I created views under Partials\blocklist to do this. I will dig out my code later and see if I can remember what I did.
Is it possible to render a blocklist inside of another block list?
Good afternoon everyone, I'm trying to see if I can render a nested blocklist inside of another. I am able to this with a blocklist that contains a single type of block. I would like to do this with a blocklist that contains multiple types of blocks.
For example I'm working on a block that will have two sections a content column for my blocklist and an aside column for a grid editor so I can utilize macros in my aside (sub nav, etc..).
I'm unable to get the nested blocklist to render at all.
Any ideas? Thanks in advance.
Hi,
Yes, it is possible to do this. IIRC, I created views under Partials\blocklist to do this. I will dig out my code later and see if I can remember what I did.
Awesome, thank you very much!
I got it, it's amazing what happens when you use the proper helper. I tried this with the ModelsBuilder helper and got it to work.
Thank you again!
Glad you sorted it 🙂
I don't see the answer here. Any clue would be helpful as I'm trying to nest a BlockList inside a BlockGrid item.
Thanks.
Craig100,
I'll go back and see what I was working on at the time, what version of Umbraco are you using?
Thanks Robert. It was 10.5.1. I've sorted it out now but it might be useful for others who chance by :)
So after looking back, this was for a Umbraco 10.1 before the Block Grid Editor which would do this differently.
My Block (I called it Macro Aside):
contentBlocks: Used a Block List Editor
The I had asideContent with a Grid Layout Editor
Here is what I used in my view:
Ah, cool.
Mine turned out to be using the non-ModelsBuilder method when I should have used the ModelsBuilder method!
I'd used:-
@Html.GetBlockListHtml(Model.Content.AccordionItems, "accordionItem")
When it should have just been:-
@Html.GetBlockListHtml(Model.Content.AccordionItems)
Anyway, all's well that ends well, as they say ;)
is working on a reply...