Removing extra DIVs from EPiServer Content Areas

Vote:
 

Hello,

This article(https://www.dcaric.com/blog/removing-extra-divs-from-episerver-content-areas) 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?

Thanks.

#205208
Jul 01, 2019 23:10
Vote:
 

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":

https://github.com/valdisiljuconoks/EPiBootstrapArea#skip-item-wrapper-element 

This will let you avoid rendering the wrapper div.

#205209
Jul 01, 2019 23:37
Kris B - Jan 29, 2021 17:45
THANK YOU!!! :)
Vote:
 

Thanks again Kenny you're a lifesaver.

#205210
Jul 01, 2019 23:54
Vote:
 

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

#205211
Jul 01, 2019 23:56
Vote:
 

Haha kudos to him as well!

#205212
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.