Adds support for the Word Count & Char Count Plugin for CKEditor.
It can be enabled per filter format, and will show you the paragraph and word count, as well as count spaces as characters or count HTML as characters if you select those options. You can also set a maximum limit on total words or total characters, which will prevent input in CKEditor after that limit.
While this will prevent entry on the client side, you should not rely on this as any sort of field validation. This will also have no effect on non-CKEditor based fields.
Requires core CKEditor and CKEditor Notification module.
How to install
Manual installation
- Download the plugin from http://ckeditor.com/addon/wordcount
- Place the plugin in the root libraries folder (/libraries/ckeditor-wordcount-plugin).
Finally, enable CKEditor Wordcount module in the Drupal admin.
Each filter format will now have a config tab for this plugin.
Composer-based installation
Method 1 - using composer-merge-plugin (recommended for versions 2.x of the module)
This method has the advantage of placing the maintenance of the plugin version
on the hands of the module maintainers. To add the composer-merge-plugin, run
composer require wikimedia/composer-merge-plugin
.
Then, update the extra section of the root composer.json
file as follows:
"extra": {
"merge-plugin": {
"include": [
"[web-root]/modules/contrib/ckwordcount/composer.libraries.json"
]
}
}
Replace [web-root]
with the value of your web root folder (usually web
).
Run composer require drupal/ckwordcount w8tcha/ckeditor-wordcount-plugin
,
the WordCount Plugin will be installed to the libraries
folder automatically.
Method 2 - using a custom repository (required in versions 1.x of the module)
Copy the following into the root composer.json
file's repository
key
"repositories": [
{
"type": "package",
"package": {
"name": "w8tcha/ckeditor-wordcount-plugin",
"version": "1.17.8",
"type": "drupal-library",
"dist": {
"url": "https://github.com/w8tcha/CKEditor-WordCount-Plugin/releases/download/v1.17.8/CKEditor-WordCount-Plugin.zip",
"type": "zip"
}
}
}
]
Run composer require drupal/ckwordcount w8tcha/ckeditor-wordcount-plugin
,
the WordCount Plugin will be installed to the libraries
folder automatically as well.
Project information
- Module categories: Content Editing Experience, Developer Tools
- 2,663 sites report using this module
- Created by kevinquillen on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Drupal 10 support
Development version: 2.x-dev updated 22 Sep 2022 at 12:42 UTC
Drupal 10 support
Development version: 8.x-1.x-dev updated 19 Feb 2024 at 00:27 UTC