CKEditor plugin for ASP.NET, 'ExtraPlugins' property doesn't work-Collection of common programming errors
I have done some experiments and finally I know how it works.
The following ASP.NET CKEditor Web Control tag is placed in *.aspx page:
Then, this tag is rendered in the outcoming HTML document and shipped to the user browser in that way:
First part:
//
Second part:
Third part:
///g,'>');}else{var g=CKEDITOR.instances[d];if(e&&(typeof Page_BlockSubmit=='undefined'||!Page_BlockSubmit)){g.destroy();f=document.getElementById(d);if(f)f.style.visibility='hidden';}else g.updateElement();}};(function(){if(typeof CKEDITOR!='undefined'){var d=document.getElementById('CKEditor1');if(d)d.style.visibility='hidden';}var e=function(){var f=CKEditor_Controls,g=CKEditor_Init,h=window.pageLoad,i=function(){for(var j=f.length;j--;){var k=document.getElementById(f[j]);if(k&&k.value&&(k.value.indexOf('')==-1))k.value=k.value.replace(/</g,'').replace(/&/g,'&');}if(typeof CKEDITOR!='undefined')for(var j=0;j
In the third part of source code, there is the most important statement, which is rendered equivalent of ASP.NET CKEditor tag:
CKEDITOR.replace('CKEditor1',{"extraPlugins" : "phrases", "htmlEncodeOutput" : true, "toolbar" : "Basic"}); });
As we can see, ASP.NET WebControl’s property ExtraPlugings
is linked with extraPlugins
property in Javascript configuration of CKEditor instance.
After some recognitions it turns out that JS configuration extraPlugins
option actually doesn’t attach plugin to be visible in CKEditor toolbar and ready to use, but in fact only register the plugin to allow to use it. Plugin can be registered in that way, or in config.js
configuration file of CKEditor:
CKEDITOR.editorConfig = function( config )
{
config.extraPlugins = 'phrases';
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};
After registration, the plugin have to be somehow added to the toolbar to be available for use, for example in that manner:
or by use of Javascript Code.
Thus, in summary: ExtraPlugins
property only cause a registration of plugin. If we want to have it on CKEditor Toolbar, we have to write proper statements to configure CKEDitor toolbar.