I try to setup font color with CKeditor5 in Sulu CMS (version 2.2.1), I followed this doc to do this.
So first I've added this line into assets/admin/package.json file (into "dependencies" object) :
"@ckeditor/ckeditor5-font": "^23.0.0",
Then I've added this lines into assets/admin/index.js file :
import {ckeditorPluginRegistry, ckeditorConfigRegistry} from 'sulu-admin-bundle/containers';
import Font from '@ckeditor/ckeditor5-font/src/font';
ckeditorPluginRegistry.add(Font);
ckeditorConfigRegistry.add((config) => ({
toolbar: [...config.toolbar, 'fontColor', 'fontBackgroundColor'],
}));
And then I run this command : bin/console sulu:admin:update-build
For the questions asked, I anwser the following:
- Do you want to overwrite your local version of 'index.js' ? N
- Do you want to overwrite your local version of 'package.json' ? N
- Merge 'package.json' together like above ? Y
- Do you want to create a build now ? Y
This work great, I can set colors and background colors into my text_editor content-type.
But when I try to add an image with a single_media_selection content-type, I have an blank page with this error into the browser console :
TypeError: (void 0) is not a function
If I remove all lines that I've added, single_media_selection work great, but I can't change colors into CKeditor.
Does I made a mistake somewhere ?