ck editor

Add plugin to CKEditor


How to add a CKEditor plugin?


In your templateSet module, add the plugin.js in a folder following this naming convention : /javascript/ckeditor/plugins/nameOfThePlugin/plugin.js

In your CKEditor configuration, add the following line to load the plugin.js file :

CKEDITOR.plugins.addExternal('nameOfThePlugin', ((typeof contextJsParameters != 'undefined') ? contextJsParameters.contextPath : '')  + '/modules/nameOfYourTemplateSet/javascript/ckeditor/plugins/nameOfThePlugin/plugin.js');

In your config function, add your plugin to the extraPlugins variable :

CKEDITOR.editorConfig = function( config ) {
    config.extraPlugins = 'nameOfThePlugin';