xonorageous
xonorageous

Reputation: 2281

Stop CKEditor removing divs

I've installed CKEditor in the backend of my website. I've got the following problem when switching from code view to wysiwyg view. The code I'm inserting is like:

<div class="span4">
    <p>Some text here</p>
</div>

When I switch back to view mode CKEditor automatically removes the div surrounding the paragraph.

Can anyone please help me to remove this problem? I don't mind staying in code view but I do like working in the view mode for writing longer text.

Thanks in advance.

Upvotes: 9

Views: 15613

Answers (3)

Sijo Thomas Maprayil
Sijo Thomas Maprayil

Reputation: 1680

var editor1=CKEDITOR.replace('editor1');
editor1.config.allowedContent = true;

Upvotes: 2

oleq
oleq

Reputation: 15895

Instead of disabling the ACF feature, use config.extraAllowedContent:

editor.config.extraAllowedContent = 'div(span4)';

or

editor.config.extraAllowedContent = 'div(*)';

Upvotes: 7

Spons
Spons

Reputation: 1591

Like AlfonsoMl said, this has something to do with the Advanced Content Filter

For all support about this look here: http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter

or put the following line in your config to disable the content filter. (It's better to configure it)

CKEDITOR.config.allowedContent = true;

Upvotes: 11

Related Questions