Try our conversational search powered by Generative AI!

"Display as" implementation for blocks.

Vote:
 

Hi.

Im trying to implement the "display as" function for blocks on a 7.5 application.

Ive read the official guidelines (http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/75/Rendering/Display-options/Display-options/) about how to configurate and enable the feature.

However theres no explaination about how to access these properties in code. I can enable a "display as" option in the user interface but how do i grab these display options in code in order to affect the CSS depending on choosen option?

Im using a MVC structure. No alloy templates.

#118516
Mar 09, 2015 11:04
Vote:
 

It depends what you need to do. From the model side of things ContentArea.Items returns a list of ContentAreaItem, these items have a DisplayOption property.

Otherwise from the view side of things you can do something with the ContentAreaRenderer. You can replace this renderer with a custom one if you need to do some additional processing on each content area item when rendering. There is an example of this in the Alloy Templates.

#118545
Mar 09, 2015 17:39
* 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.