Try our conversational search powered by Generative AI!

Adding a css class to the wrapping div of all ContentAreas

Vote:
 

Hi, I want to add a CSS class to the wrapping div of all ContentAreas. To do this with one ContentArea is easy:

@Html.PropertyFor(m => m.MainContent, new { cssClass="contentArea"})

The problem with this solution that I have to add this to all content areas in all views. Is there a better way to do this?

#197120
Sep 24, 2018 9:40
Vote:
 

You can write your own handler that rendering the content area. (https://world.episerver.com/documentation/class-library/?documentId=cms/7.5/C2943161)

Read more about it here in the blog by the great @valdis!
https://blog.tech-fellow.net/2015/06/11/content-area-under-the-hood-part-3/

#197123
Sep 24, 2018 12:25
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.