Try our conversational search powered by Generative AI!

ContentArea / Blocks - selecting which view to render for a block when placed on a content area.

Vote:
 

Im sure this is a common question, but how would one go ahead giving the editor the ability to select a tag for a content area? Perhaps a custom contentarea with a list of tags?

The premise is that we would like the ability to select a rendering for a block which may have multiple views (and controllers). For isntance, I may have a News Article block with a detail, summary and CTA view, each surfacing different properties of the block.

"Display Options" isnt really much help hear as I only want the editor to select tags appliable to that block, not have a list of all the display options, some of which will not be avaialble for the block.

Also, a dropdownlist of options as a property on the Block isnt ideal as then the block controller has to have logic to determine which view to return, which strikes me as not a very SOLID approach.

Ideally I can create my News Article block, place it on a content area (e.g. a main content region, sidebar region, footer region) and be able to select whcih view to render from a list of those that block supports only.

#180817
Jul 27, 2017 12:32
Vote:
 

There's a blog post with a workaround. Does this help?

https://getadigital.com/no/blogg/filtered-display-option-menu-based-on-content-type-in-episerver/

#180826
Jul 27, 2017 17:24
* 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.