episerver / EPiServer.Labs.BlockEnhancements

Block enhancements for CMS UI.
26 stars 9 forks source link

Preview + Content Draft mode does not render blocks that have additional blocks in them #80

Closed prsavin25 closed 3 years ago

prsavin25 commented 3 years ago

Hello Team,

We have come across a situation where we have blocks nested inside other blocks. When you are in preview mode in combination with Content Draft mode, the first level blocks get rendered correctly (with their appropriate draft content). However, the second level of blocks does not show the appropriate draft content and only shows published content.

We have scenarios where there may be third levels of blocks too (specific to our implementation). Our request is to have the Content Draft + Preview mode work recursively for the blocks so that all the content in the draft is rendered appropriately.

This is for a project that we have to deliver soon. If there is somewhere you can point me in the code that I can start making modifications, I can certainly do that and submit a pull request for this once complete. Basically, any help you can provide at this time would be greatly appreciated!

Thanks, Pravin

barteksekula commented 3 years ago

so you have page that has a ContentArea property and inside that you have blocks that also have ContentArea property? right? how do you render the properties? do you use html helpers?

prsavin25 commented 3 years ago

Thanks for responding back. Yes, We have pages that have ContentArea where we can add blocks having ContentArea property. This way we have 3 levels of nesting of Blocks in ContentArea. I am rendering the all the ContentArea property(on the page and blocks) using HTML helpers i.e @Html.PropertyFor(x=>x.ContentArea). Hope this is helpful.

barteksekula commented 3 years ago

Content Draft Mode was removed in 0.11.0 The new approach promotes local content - with unlimited nesting level.