Prevent Div-Wrapping on Inline-Elements

Hi @mad,
so in general the override is correct. Just set templatePath for that nodeType. The error just says that it can not find your custom template. Where is it located in your filesystem?

You do need indeed a wrapper for the inline editing to work. If you check the https://github.com/neos/neos/blob/master/Classes/TYPO3/Neos/ViewHelpers/ContentElement/EditableViewHelper.php you can see the $tag property wich defaults to div. You could override that with anohter tag.

What you could also do is to render 2 templates. One for the editors and one for the frontend.

{namespace neos=TYPO3\Neos\ViewHelpers}
<f:if condition="{neos:rendering.inBackend()}">
<f:then>
    <div{attributes -> f:format.raw()}>
       {neos:contentElement.editable(property: 'title')}
    </div>
<f/then>
<f:else>
     {title}
</f:else

something like this. You could also add an @if or somethint in your prototype and render different sections or html files

1 Like