stefanogualdi / grails-ckeditor

Grails CKEditor plugin
http://grails.org/plugin/ckeditor
Apache License 2.0
23 stars 32 forks source link

How to add plugins for CKEditor #27

Closed dongxuwang closed 8 years ago

dongxuwang commented 8 years ago

For example, http://ckeditor.com/addon/wordcount

stefanogualdi commented 8 years ago

You have to use the external configuration.

in application.yml add:

ckeditor:
  config: "/ckeditor/ckconfig.js"  

create the file ckconfig.js under /src/main/resources/public/ckeditor

with the following content:

CKEDITOR.plugins.addExternal('wordcount', '/ckeditor/plugins/wordcount/');
CKEDITOR.plugins.addExternal('notification', '/ckeditor/plugins/notification/');
CKEDITOR.editorConfig = function( config )
{
  config.extraPlugins = 'wordcount,notification';
};

copy the plugins under /src/main/resources/public/ckeditor/plugins

dongxuwang commented 8 years ago

Pretty cool, thanks heaps.