HTML property in a document type

Hi,

I want to create a new document type with a html property to store a div element like this without any more markup:

If I use the Html simple field in the document type editor it will be saved as a string and will be rendered as text also if i use the hst:html tag with formattedText in the freemarker template.

If I use the richText compound field, I can add the div in the source code view but if I save the document and reopen it to edit again I can’t see the div entry in the property. Neither in the text nor in the source code view but I can see the div in the rendered page.

I’ve added the div node to the formattedText and richText node in the htmlprocessor configuration.
How is it possible to use the html simple field to store the div element and render it as HTML or is it possible to see the saved html property in the source code view if I want to edit the document?

Best regards
Philipp

see:

You need to configure both, client and server side cleaning.

I configured both. On the client side I have disabled cleaning with

{
 allowedContent: true
}

and on the server side divs are allowed. I configured it for richtext and formatted text.
I can add the div to the richtext but I can’t se it if I try to edit it again in the editor. If I take a look into the document.yaml I can see the added div and if I take a look into the page, the div is rendered as html in the page but I can’t see it in the richtext editor.
If I add text between the div tags or another div with text content I can see and edit the div.
I want to add divs like this:
<div class="lazy" data-on-inview="JavaScript function" id="eexbs14jxvjmxbg"></div>
Sorry I forgot to insert the div as embeded code in the first post, so it was not displayed.