We have a set up that allows us to render a Block Grid in a Block List component, which is designed (currently) to allow us to render a two-column section in the list.
The problem is that the content in the Block Grid doesn't render at all in this situation, because the actual content is being substituted out for string in the AREA_TEMPLATE constant when in fact it needs to be rendered correctly in this instance.
I've resolved this by adding another ViewData entry called "blockGridPreview" in BackOfficeGridPreviewService and checking for that in the GetPreviewBlockGridItemAreasHtmlAsync extension method and friends. This will only be set if the Grid is the primary property type.
This will still not work if we have a Grid Block nested in a Grid Block for some reason (and why would you want to anyway).
A better solution may be to somehow scope the substitution that these extension methods do to the current "nesting level" and ensure it's only done if at the root of the tree.
We have a set up that allows us to render a Block Grid in a Block List component, which is designed (currently) to allow us to render a two-column section in the list.
The problem is that the content in the Block Grid doesn't render at all in this situation, because the actual content is being substituted out for string in the
AREA_TEMPLATE
constant when in fact it needs to be rendered correctly in this instance.I've resolved this by adding another ViewData entry called "blockGridPreview" in
BackOfficeGridPreviewService
and checking for that in theGetPreviewBlockGridItemAreasHtmlAsync
extension method and friends. This will only be set if the Grid is the primary property type.This will still not work if we have a Grid Block nested in a Grid Block for some reason (and why would you want to anyway).
A better solution may be to somehow scope the substitution that these extension methods do to the current "nesting level" and ensure it's only done if at the root of the tree.
There's a PR coming to resolve this.