strips the class from the <div> tag in rich text editor

TRISHUL TANDEL asked on June 28, 2017 20:37

strips the class from the <div> tag in rich text editor. I already tried for make changes in config file of CKEditor, but not successed.

Please help me...

Correct Answer

TRISHUL TANDEL answered on June 29, 2017 08:20

I have resolved this issue with the help of generate ticket in kentico support. Please perform below steps:

  1. Editing the following file: \CMS\CMSAdminControls\CKeditor\config.js

  2. Add the following to the end of the configuration:

    CKEDITOR.dtd.$removeEmpty['div'] = false;

  3. Save the file and clear your browser cache, clear cache and restart Kentico from the System application in the administration.

  4. Test CKEditor in a separate browse in incognito or private browsing mode to ensure caching does not provide a false positive.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on June 28, 2017 21:02

If your class is empty or if your div element is empty, it will remove the class attribute and/or the div element. You have to tell the editor to ignore the empty attributes or elements.

CKEDITOR.dtd.$removeEmpty['div'] = false;

2 votesVote for this answer Mark as a Correct answer

TRISHUL TANDEL answered on June 28, 2017 21:15

Thanks for quick response.

Where i need to make this changes ?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 28, 2017 21:18

In the config.js file for the editor where you had already stated you made changes.

/CMSAdminControls/CKEditor/config.js

0 votesVote for this answer Mark as a Correct answer

TRISHUL TANDEL answered on June 28, 2017 21:31

I try but not going to effect. Same issue yet.

Also there is not any empty tag and class in my html.

before

 <div class="col-md-8">
  <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p></div> <div class="col-md-4"><img src="img/faq-sub.jpg" alt=""></div>

After

<div><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p></div><div></div>
0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 29, 2017 20:34

Glad my answer was able to fix your problem.

0 votesVote for this answer Mark as a Correct answer

TRISHUL TANDEL answered on June 29, 2017 20:52

yes, your answer is also correct but get proper step by step answer from kentico support

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.