Closed bielu closed 3 months ago
I spend some time debugging our solution to notice this bit of docs is kinda incorrect: https://github.com/rickbutterfield/Umbraco.Community.BlockPreview#grid-specific-setup If you replace all block rendering methods with preview ones, you will have no render of nested elements.
So I played around and noticed, this when I set:
- Default grid view to use GetPreviewBlockGridItemsHtmlAsync
- area view to use GetBlockGridItemsHtmlAsync
- areas view to use GetBlockGridItemAreaHtmlAsync
is only case when i get all preview render correctly.
So based on my observation, it doesnt work if you use Preview Methods everywhere, but it works perfectly when you use the Preview method on Root view for current preview.
@bielu, I also found your described setup to be necessary to allow preview of nested block grid/list editors to be supported across the CMS.
@rickbutterfield, perhaps the documentation needs an update?
Hey @bielu and @timeverts, thanks so much for raising the issue. This appears to be the same issue as #47 and a fix is incoming in v1.8.1, releasing later today or early tomorrow.
In every test I've done when working on it, I've tried using both the GetBlockGrid...
and GetPreviewBlockGrid...
methods, and it only appears to work for me correctly when using the Preview
versions, so it would be good to get your feedback post-release.
@rickbutterfield it is not same issue, as this issue was related to umbraco 10, #47 is related to this : https://github.com/umbraco/Umbraco-CMS/pull/15799 which was breaking change in umbraco v13. but fix might actually fix both, so will test it :)
Your changes for https://github.com/umbraco/Umbraco-CMS/pull/15799 are exactly where I found the issue in BlockPreview! I've now added code that handles that case and converts nested lists and grids to from JSON to string
, so that the conversion can happen.
v1.8.1 is released now, if you are able to test and confirm if it's working?
Yeah, it actually caused more issues for me, will try find issue for it and submit pr :)
Hmm interesting 1.8.2 with umbraco 13.2.2 seems to solve issue 🤔, not sure how but it works! 😂 However it still require me mixing of GetPreviewBlockGridItemsHtmlAsync and GetBlockGridItemsHtmlAsync
I spend some time debugging our solution to notice this bit of docs is kinda incorrect: https://github.com/rickbutterfield/Umbraco.Community.BlockPreview#grid-specific-setup If you replace all block rendering methods with preview ones, you will have no render of nested elements.
So I played around and noticed, this when I set:
is only case when i get all preview render correctly.
So based on my observation, it doesnt work if you use Preview Methods everywhere, but it works perfectly when you use the Preview method on Root view for current preview.