CKEditor关闭高级内容过滤器

CKEditor关闭高级内容过滤器,ckeditor,Ckeditor,我很难停用高级内容过滤器config.allowedContent=true;似乎不起作用。我已经尝试了在论坛上读到的所有内容,包括清除缓存,并将其设置为外部文件 我甚至添加了config.protectedSource.push行,它们在一定程度上起作用。CKEditor仍然添加div标记,并部分删除其他标记 我正在为客户创建一套设计良好的模板,以便使用,因此最终我不希望CKEditor触及我的代码。下面是我在config.js中看到的内容。如果有人看到我做错了什么,或者知道如何让它工作,请帮

我很难停用高级内容过滤器config.allowedContent=true;似乎不起作用。我已经尝试了在论坛上读到的所有内容,包括清除缓存,并将其设置为外部文件

我甚至添加了config.protectedSource.push行,它们在一定程度上起作用。CKEditor仍然添加div标记,并部分删除其他标记

我正在为客户创建一套设计良好的模板,以便使用,因此最终我不希望CKEditor触及我的代码。下面是我在config.js中看到的内容。如果有人看到我做错了什么,或者知道如何让它工作,请帮助这个有点紧张的网络家伙

谢谢, 生锈的

})

我正在为客户创建一套设计良好的模板,以便使用,因此最终我不希望CKEditor触及我的代码

这是不可能的。CKEditor不是一个可以加载任何可能的HTML的网站生成器。它是一个富文本编辑器。所以你应该用它来编辑网站的文本部分,而不是整个布局

例如,如果您的布局有两列,并且上面有一些标题,那么最好有三个编辑器——每列一个,标题一个。当然,在这种基本情况下,可以使用CKEditor一次编辑一个或三个部分,但布局越复杂,正确使用CKEditor就越重要


注:是CKEditor,不是CKEditor。

谢谢您的回复

我说的不是网站设计模板,而是页面设计模板。在全功能版本的CKEditor上有一个模板按钮,我们已经能够对其进行增强。我们现在可以让我们的客户选择几个设计良好的页面布局,对不同的设计做出响应。这是非常有效的

在尝试了一切之后,我找到了导致问题的罪魁祸首。我用的是,而不是。我一切换编辑器,代码就不受影响了

致以最良好的祝愿!
Rusty

我使用的ckEditor版本是ckEditor 4.4.7
CKEDITOR.editorConfig = function( config ) {
config.toolbarGroups = [
{ name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'insert' },
{ name: 'links' },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'tools' },
{ name: 'about' }
];

// Define changes to default configuration here. For example:
// config.uiColor = '#AADC6E';
// misc options
config.allowedContent = true; // allowedContent doesn't work :-(
// Protected Source
config.protectedSource.push(/<section>[\s\S]*?<\/section>/gi); // allow <section></section>
config.protectedSource.push(/<span>[\s\S]*?<\/span>/gi); // allow <span></span>
config.protectedSource.push( /<link[\s\S]*?\>/g ); // allow <link> tag
config.protectedSource.push( /<!--[\s\S]*?\>/g ); // allow <comment> tag
config.protectedSource.push( /<br[\s\S]*?\/>/g );   // allow BR Tags
config.protectedSource.push(/<script>[\s\S]*?<\/script>/gi); // allow <script></script>
config.protectedSource.push(/<div>[\s\S]*?<\/div>/gi); // allow <div></div>

config.removeButtons = 'Anchor,Iframe';
config.format_tags = 'p;h1;h2;h3;h4;h5;h6'; // format button options
config.height = '500px'; // edit window height
config.skin = 'moono';
config.stylesSet = 'vam_styles:/templates/admin/-css/vam_styles.js'; // style button options
// Only add rules for p and span elements.
config.stylesheetParser_validSelectors = /\^(p|span\div)\.\w+/;
config.stylesheetParser_skipSelectors