The solution works if you want to grab a Block List from the root node, or a parent, but doesn't give a full Fallback.ToAncestors functionality.
A better solution for full recursive block list rendering is to Set the BlocklistModel object recursively, then pass that object into Html.GetBlockListHtml()
Example
@{
var blocks = Model.Value<BlockListModel>("blocks", fallback: Fallback.ToAncestors);
}
@Html.GetBlockListHtml(blocks)
render block list recursively
How do i render a block list recursively.
For example i'm using a block list in my footer, which is want to render on all pages...
Doesn't work
Do it like this my friend:
That should work, but doesnt in my case, so i did:
Wow, thanks H5YR!
He's very good that @Claushingebjerg - you should buy him a beer if you get the chance!
I think i will... Today! :)
Glad you got it working, but can't you just do it like with any other property?
Dont think so:
The solution works if you want to grab a Block List from the root node, or a parent, but doesn't give a full Fallback.ToAncestors functionality.
A better solution for full recursive block list rendering is to Set the BlocklistModel object recursively, then pass that object into Html.GetBlockListHtml()
Example
is working on a reply...