Hi,
We recently upgraded to 4.4.3 and now our locally developed plugins arent working.
We have a plugin that inserts custom tags like the below:
editor.insertHtml('<first-page-header>header</first-page-header>');
When we view the source, instead of seeing:
<first-page-header>header</first-page-header>
we see:
<p>header</p>
We have tried setting allowedContent=true in the config.js but it has no effect:
config.allowedContent = true;
We have also tried setting extraAllowedContent='first-page-header'; and allowedContent='first-page-header';
This is out config.js code:
CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'first-page-header,first-page-footer,page-header,page-footer,hard-page-break'; config.allowedContent = true; config.toolbar_Corresponding = [ ['Source','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],'/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor','-','Image','Table','HorizontalRule','SpecialChar','PageBreak'],'/', ['Styles','Format','Font','FontSize','-','TextColor','BGColor','-','Maximize','ShowBlocks'], ['first-page-header', 'first-page-footer','page-header','page-footer','hard-page-break'] ]; config.toolbar_Full = [ ['Source','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Checkbox','Radio','TextField','Textarea','Button','ImageButton'], '/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor','-','Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],'/', ['Styles','Format','Font','FontSize','-','TextColor','BGColor','-','Maximize','ShowBlocks'] ]; config.toolbar_Basic = [ ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About'] ]; };
This is our plugin code:
(function() { var a ={exec:function(editor) { editor.document.createElement( 'first-page-header' ); editor.insertHtml('<first-page-header>Insert first page header text here</first-page-header>'); } }, b = 'first-page-header'; CKEDITOR.plugins.add(b,{ init:function(editor){ editor.addCommand(b,a); editor.ui.addButton('first-page-header',{ label:'First Page Header', icon: this.path + 'first-page-header.png', command:b }); } }); })();
Any ideas what we're missing?
Thanks,
Peter
Adding your sample code (
Adding your sample code (<first-page-header>header</first-page-header>) with config.allowedContent = true; in config.js results in the code staying as is for me. Have you tried clearing your cache? Pressing F5 isn't enough. You have to clear it manually.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Thanks for the reply Seb!
Thanks for the reply Seb!
We have cleared the chache manually and have confirmed that the new files are being loaded correctly.
Furthermore, interrogating the DOM in firebug shows the following:
CKEDITOR.instances.[pageInstance].activeFilter.disabled=true;
CKEDITOR.filter.instances.4.disabled=true
currentEditor.activeFilter.disabled=true
etc.
These values change to false if we omit allowedContent=true from the config file so i assume we are on the right track here??
So it seems that although the filter is disabled, the content is still being filtered.
Any suggestions how i can interrogate the DOM to get to the bottom of this issue?
Thanks,
Peter
FYI: I solved this by:
FYI: I solved this by:
1.\ Changing the plugin code to use insertElement instead of insertHtml.
2.\ Putting CKEDITOR.config.allowedContent = true; outside the config function.
CKEDITOR.editorConfig = function( config )
{ ...}
CKEDITOR.config.allowedContent = true;
pfuller you are correct
pfuller you are correct
------------------------------------------
Gatwick Taxi