Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Removing extra DIVs from EPiServer Content Areas



This article( explains how to remove a div when using the helper Html.PropertyFor.

In the article it exmplains you cannot disable those divs by setting childrencustomtagname to an empty string because childrencustomtagname fallbacks to div and then provides a class which apparently handles the removal of the div. I find this to be an over the top way of handling something that should be really simple. Also very little is explained with the method they have provided. If I don't want a surrounding div for a element, shouldn't there be a straightforward solution for that?

Would there happen to be an alternative for disabling div elements for content area items in view mode, not just to replace them with another element?


Jul 01, 2019 23:10

I think Valdis Iljuconoks's EPiBootstrapArea NuGet package will solve this for you. Look at the section of the readme regarding "Skip Item Wrapper Element": 

This will let you avoid rendering the wrapper div.

Jul 01, 2019 23:37
Kris B - Jan 29, 2021 17:45

Thanks again Kenny you're a lifesaver.

Jul 01, 2019 23:54

Just having a lucky day. Valdis gets all the credit.

Jul 01, 2019 23:56

Haha kudos to him as well!

Jul 02, 2019 0:00
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.