Remove unnecessary div in nodetypes

There are unneccessary divs (without attributes) rendered by neos for example inside of typo3-neos-nodetypes-text. Is it possible to remove them?

< div class=“neos-contentcollection”>
< div class=“typo3-neos-nodetypes-text”>
< div>
< p>Original Text</ p>
</ div>
</ div>
</ div>

As described here you can only remove div wraps with classname like < div class="neos-contentcollection>…< /div>

The inner div without attributes is needed in the backend to add metadata that is not shown in the frontend. You can get rid of that with a custom editable viewhelper or just an <f:if in the template either just rendering the text for frontend or the editable viewhelper in backend.
Additionally if your text consists of only one paragraph you could disable block styles for the editor and make the editable viewhelper use a p tag to add the metadata.

Ah ok. Tanks!

Maybe the code-template under Prevent Div-Wrapping on Inline-Elements will help you for text: Same procedures …

1 Like

Yes, thats exactly what i did now. i just didnt know where the lonely div comes from. It came from the neos:contentElement.editable viewhelper. Thanks!

Is there a way to get rid of the outermost div that gets produced with Neos.Neos:PrimaryContent:
< div class=“neos-contentcollection”>