Add plugin to CKEditor

  Written by The Jahia Team
 
Developers
   Estimated reading time:
7.1.0.1

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