CKEditor Stripping Out Some of Our CSS classes

时间:2015-07-13 21:02:29

标签: ckeditor

We are having a problem with CKEditor (ver 4.1.1.5) stripping out some of our css classes when we are editing in the FULL HTML mode using SOURCE. From looking at some of the other questions posed on this, the Advanced Content Filter is the place we should be going. And, if I read this correctly, we need to edit the config.js file to add: CKEDITOR.config.allowedContent=true;

Am I going in the right direction? I want the WYSIWYG to still work for people with no html experience. However, when we go into source, I want all classes to remain and not be stripped out, no matter what.

1 个答案:

答案 0 :(得分:0)

你是对的:

  • 是的,高级内容过滤器(ACF)是负责此事的机制。
  • 但不,将config.allowedContent设置为true不是正确的解决方案。

简而言之,ACF是一种有用的机制,可让您轻松控制用户使用CKEditor添加到您网站的内容。但是,您应该扩展过滤器配置以接受您想要允许的任何其他元素,类,样式和属性,而不是禁用它。

在您的情况下,如果您想要additionally allow所有元素的所有类,请在editor configuration中使用此类:

config.extraAllowedContent = '*(*)';

在此处阅读有关ACF的更多信息: