I am working in a djangocms project that uses the djangocms_text_ckeditor https://github.com/divio/djangocms-text-ckeditor
I would like to integrate a wordcount plugin similar to this https://github.com/w8tcha/CKEditor-wordcount-Plugin
Have someone of you did this before successfully? It would be great if I could get the plugin via pip or so, not downloading and including it in the project. And also, how would the CKEDITOR_SETTINGS look like?
I couldn't find any workaround, just a similar post but that does not use this djangocms text editor for that purpose.
Thanks in advance!
The extension is a javascript plugin for the ckeditor (as opposed to a djangocms plugin).
To load a javascript plugin two steps are needed:
Make the js plugin resources available to ckeditor. This is done through
static
folder in your project wich includes all js, css etc. files. In thestatic
folder create the foldersdjangocms_text_ckeditor/ckeditor/plugins
. Copy the js plugin into this folder. In your case thats the whole folderwordcount
. The directory tree should look likeLet the djangocms plugin ckeditor know about the js plugin. To this end, look for the setting
CKEDITOR_SETTINGS
in your project'ssettings.py
file. If it is not there create it. It's a dictionary that is used, e.g., to configure the toolbars. In this dictionary have a keyextraPlugins
with a string value that consists of comma separated names of plugins to load, e.g.,Hope that works for you.