A
A
Arthur2019-08-21 21:56:02
CKEditor
Arthur, 2019-08-21 21:56:02

How to wrap all text in Ckeditor in div with class?

Greetings!
There is an editor CKEditor 4 and layout, where nesting is provided . For body, adding a class does not constitute a turd, there is a bodyClass parameter for this. But I don't understand how to add a second nesting. The parameters are simply ignored. I found two possible solutions, but both are not working: 1. when starting ckeditor:.article > .content > сам контент
.articlebodyPrepend/bodyAppend

CKEDITOR.plugins.add( 'quote', {
    init: function( editor ) {
        editor.setData( '<div class="content">' + editor.getData() + '</div>' );
}})

But I do not like this option, because. the added tag is eventually added to the article (in the database) and may break the layout, because will make nesting one more.
2. Attach the article class to the html tag, and .content to the body tag. But since the editable block is hovering in the iframe, I can't get to the tag.
Actually the question is how to wrap the text in a div, or how to hang a class tag on the html? Or are there other quick solutions, without editing the layout?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question