CKEditor Configuration Properties
Bloomreach Content uses CKEditor 4 to edit HTML fields. Each CKEditor instance receives a JSON configuration object that defines its behavior.
Info: The complete list of CKEditor configuration properties is available in the CKEditor configuration reference.
The final JSON configuration for each HTML field is determined by three sources:
-
Default JSON Configuration for the HTML Field Type
The default configuration is defined as a string constant in the Java source code of the field plugin:
-
The
ckeditor.config.overlayed.jsonPropertyYou can set this property globally or for a specific field. For details, see HTML fields configuration properties.
- Primitive values (strings, numbers) and arrays in this JSON object replace properties with the same name in the default configuration.
- Object properties are merged recursively with matching properties in the default configuration.
-
The
ckeditor.config.appended.jsonPropertyYou can set this property globally or for a specific field. For details, see HTML fields configuration properties.
- Properties in this JSON object are appended to the result of the overlayed configuration.
- Arrays are extended by joining the new values.
- Strings are appended to existing strings, separated by a comma. This is useful for comma-separated plugin lists.
- Use this property to add multiple elements to an existing array.
Example
The following example shows how the three configuration sources are combined:
| Default configuration | ckeditor.config.overlayed.json | ckeditor.config.appended.json |
|---|---|---|
{ codemirror: { autoFormatOnStart: true }, ignoreEmptyParagraph: false, keystrokes: [ [ 77, 'maximize' ] ], plugins: "foo,bar" } | { codemirror: { autoFormatOnStart: false, }, ignoreEmptyParagraph: true } | { keystrokes: [ [ 88, 'showblocks' ] ], plugins: "myplugin" } |
After merging, the resulting configuration is:
{ codemirror: { autoFormatOnStart: false, }, ignoreEmptyParagraph: true, keystrokes: [ [ 77, 'maximize' ], [ 88, 'showblocks' ] ], plugins: "foo,bar,myplugin" }
Hint: To debug the merge process of the default, overlayed, and appended JSON configurations, set the log level of
org.onehippo.ckeditor.CKEditorConfigto DEBUG.
Hint: To inspect the client-side configuration for each editor, open your browser's JavaScript console and view the
CKEDITOR.instancesobject. This object contains all CKEditor instances on the current page. The configuration for a specific editor is available atCKEDITOR.instances.<editorId>.config.