Try our conversational search powered by Generative AI!

Easiest way to get rid of extra DIV-tags when rendering content areas (MVC mode)?

Vote:
 

Hi!

What would you say is the easiest way to get rid of extra DIV-tags when rendering content areas (MVC mode)?

I've tried this

@Html.PropertyFor(p => p.CurrentPage.MainContentArea, new { hascontainer = false })

But still an extra DIV is added.

Googling I've seen example of custom content area renderers but to me that seems overkill and messy.

#176229
Mar 14, 2017 10:06
Vote:
 

An easy solution is to create your own displaytemplate for contentarea or change the rendering of contentarea. This old but still useful blogpost might help you: http://joelabrahamsson.com/custom-rendering-of-content-areas/

In my opinon the extra div should not be a problem but as a former fron-end lover I also understand that we should not have more html then we use :) 

#176253
Mar 14, 2017 15:09
* 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.