Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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...
@Html.GetBlockListHtml(Model, "sidefod", fallback: Fallback.ToAncestors)
Doesn't work
Do it like this my friend:
@inherits Umbraco.Web.Mvc.UmbracoViewPage @{ Layout = null; var node = Model.AncestorOrSelf(); } <div>@Html.GetBlockListHtml(node, "footer") </div>
That should work, but doesnt in my case, so i did:
@inherits Umbraco.Web.Mvc.UmbracoViewPage @{ Layout = null; var rootnode = Model.Root(); } <div>@Html.GetBlockListHtml(rootnode, "footer") </div>
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?
Html.GetBlockListHtml(node, "footer", recurse:true)
Dont think so:
"The best overload for 'GetBlockListHtml' does not have a parameter named 'recurse'"
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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:
is working on a reply...