0
votes

all. As you know that, CKEditor starts with an empty editable body tag like that:

<body contenteditable="true" class="someclasses">
</body>

I am trying to start CKEditor with an empty editable div in this body tag and wrap all content of editor by this div like that:

<body class="someclasses">
    <div contenteditable="true">

    </div>
</body>

So far, I customized ckeditor.js and achieved to do this when I add a template from the editor but this is not a proper solution because any other event can refresh editor's source code and place an empty body tag again. Also, I have to customize nearly all functions to wrap HTML content by this div tag.

Is there any way to define a default wrapper other than body tag of CKEditor? Thank you.

Edit: To be more clear, I want to define a div inside body section of CKEditor and any content must be placed into this automaticaly like added templates, text, images etc...

1
Will this addon help you? ckeditor.com/cke4/addon/divarea - Wizard

1 Answers

0
votes

There is no easy solution. If you need editable wrapped by some other element maybe consider using inline editor?