Try our conversational search powered by Generative AI!

Selective block preview


I am working on a solution that has couple of different layouts. Previewing of the blocks was non-existent. Client wanted to introduce blocks with data charts and wanted to preview those charts before publishing the containg page.

All the examples of the block previewing I found so far, entail that all blocks get the preview. This poses a problem becuse blocks get rendered differently in a different layouts and that confuses the editors.

Is there any way of bypassing preview controller if block is not of a specific type or to force all properies view instead?

Mar 30, 2017 11:10

Hi Goran

I would check how things are set up in the Alloy sample site, specifically the OnTemplateResolved method of Template coordinator. You could remove a rendering for a specific block if args.Tags is for Preview.


Mar 30, 2017 13:13

Thank you David,

I did inverted thing from what was in Alloy sample site for the container pages. If block implements my interface and the template type is of block preview controller type, block gets selected template set to null.

Worked nicely.

Mar 30, 2017 13:57
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.