ck editor Jahia 7.3 Jahia 8

Add plugin to CKEditor

Question

How to add a CKEditor plugin?

Answer

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';
    ...
};