Try our conversational search powered by Generative AI!

Content area generates extra surrounding div


In order to not render the extra div that is created by Html.PropertyFor, I have implemented the custom content area renderer as per the articel from jon d jones.

However, even though I can see that it goes to the correct part of the renderer, where it should not add extra div, in the end there is an extra div.

                            htmlHelper.RenderContentData(content, true, templateModel, contentRenderer);

Does anyone have a clue how to not get the extra surrounding div?

Sep 03, 2021 11:22

We encountered this on one of our projects recently. I think that these two links may help you: 

They're both for an older version of Episerver, but I think that the approach is still valid.

Sep 06, 2021 7:51

My recommendation would be to keep the divs and have frontend deal with it. Removing them might come back to bite you later on....

Sep 07, 2021 15:56


Thank you both for your answers. I went with installing the nuget package EPiBootstrapArea which handles the removal of extra divs.

Sep 07, 2021 16:01
valdis - Sep 09, 2021 9:46
However, that package nowadays has nothing in common with Bootstrap ;)
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.