Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community
Customizing CKEditor in Craft CMS
In this short course we will learn how to extend the CKEditor field that is a first-party plugin available for Craft CMS version 5.
In this short course we will learn how to extend the CKEditor field that is a first-party plugin available for Craft CMS version 5.
In the Craft 5 compatible version of the CKEditor plugin, not every CKEditor plugin is available for us to use. CKEditor ships with plugins that aren’t available to us, and I’d like to implement them.
Looking at the plugins available in the Craft CMS version of CKEditor, we see the following plugins included:
"@ckeditor/ckeditor5-alignment": ">=41.0.0",
"@ckeditor/ckeditor5-autoformat": ">=41.0.0",
"@ckeditor/ckeditor5-basic-styles": ">=41.0.0",
"@ckeditor/ckeditor5-block-quote": ">=41.0.0",
"@ckeditor/ckeditor5-code-block": ">=41.0.0",
"@ckeditor/ckeditor5-core": ">=41.0.0",
"@ckeditor/ckeditor5-dev-translations": "^39.5.1",
"@ckeditor/ckeditor5-editor-classic": ">=41.0.0",
"@ckeditor/ckeditor5-essentials": ">=41.0.0",
"@ckeditor/ckeditor5-find-and-replace": ">=41.0.0",
"@ckeditor/ckeditor5-font": ">=41.0.0",
"@ckeditor/ckeditor5-heading": ">=41.0.0",
"@ckeditor/ckeditor5-horizontal-line": ">=41.0.0",
"@ckeditor/ckeditor5-html-embed": ">=41.0.0",
"@ckeditor/ckeditor5-html-support": ">=41.0.0",
"@ckeditor/ckeditor5-image": ">=41.0.0",
"@ckeditor/ckeditor5-indent": ">=41.0.0",
"@ckeditor/ckeditor5-inspector": ">=4.1.0",
"@ckeditor/ckeditor5-language": "^41.0.0",
"@ckeditor/ckeditor5-link": ">=41.0.0",
"@ckeditor/ckeditor5-list": ">=41.0.0",
"@ckeditor/ckeditor5-media-embed": ">=41.0.0",
"@ckeditor/ckeditor5-package-tools": "^1.1.0",
"@ckeditor/ckeditor5-page-break": ">=41.0.0",
"@ckeditor/ckeditor5-paragraph": ">=41.0.0",
"@ckeditor/ckeditor5-paste-from-office": ">=41.0.0",
"@ckeditor/ckeditor5-remove-format": ">=41.0.0",
"@ckeditor/ckeditor5-select-all": ">=41.0.0",
"@ckeditor/ckeditor5-source-editing": ">=41.0.0",
"@ckeditor/ckeditor5-style": ">=41.0.0",
"@ckeditor/ckeditor5-table": ">=41.0.0",
"@ckeditor/ckeditor5-theme-lark": "^41.0.0",
"@ckeditor/ckeditor5-upload": ">=41.0.0",
"@ckeditor/ckeditor5-word-count": ">=41.0.0",
But, looking at the CKEditor source code, there are additional plugins or packages available:
Here are three plugins I’d like to add and make available to Craft:
The ability to add plugins doesn’t end there. We can also add third-party plugins, including a completely custom plugin we create ourselves.
That all sounds well and good, but how do we access CKEditor in order to add a first- or third-party plugin? CKEditor is included in Craft via a plugin; what are our options?
Fortunately, we can use a Craft module to hook into the CKEditor Craft plugin by registering a special type of asset bundle called CKEditor package asset. This tells Craft’s CKEditor where to look for the CKEditor packages it needs to load and make available. We’ll do this inside of a Craft module.
We will use two different types of CKEditor plugins: those that are executable as toolbar items and those that function within or around the editor itself.
At the end of the course, we’ll have successfully accomplished the following:
For most people, adding a first- or third-party CKEditor plugin is probably enough but we’ll wrap up the course with a short tutorial on how to create your own custom CKEditor plugin.
Customizing CKEditor in Craft CMS is made up of the following videos: