CKEditor configuration properties
HTML fields in Bloomreach Experience Manager are edited with CKEditor 4. Each CKEditor instance gets a JSON object that configures that particular editor instance.
The final JSON configuration object of each HTML field is determined by three things:
- The default JSON configuration of the HTML field type
This is located in a string constant in the Java source code of the field plugin for that HTML field type:
- Formatted text: org.onehippo.ckeditor.CKEditorConfig#DEFAULT_FORMATTED_TEXT_CONFIG
- Rich text: org.onehippo.ckeditor.CKEditorConfig#DEFAULT_RICH_TEXT_CONFIG
- The property ckeditor.config.overlayed.json (either the global or field-specific value)
Primitive properties (like strings and numbers) and arrays in this JSON object replace properties with the same name in the default configuration. Object properties are merged recursively with object properties with the same name in the default configuration.
- The property ckeditor.config.appended.json (either the global or field-specific value)
Properties in this JSON object are appended to the result of the overlayed JSON object. Properties can be appended to arrays. Strings can also be appended to strings, in which case the original string and the appended one get separated by a comma. The latter is typically used to append string values to comma-separated strings. Arrays appended to existing arrays will be joined together. Use this to extend an existing array with multiple elements.
For example:
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" } |
The three example configurations above will be combined into:
{ codemirror: { autoFormatOnStart: false, }, ignoreEmptyParagraph: true, keystrokes: [ [ 77, 'maximize' ], [ 88, 'showblocks' ] ] plugins: "foo,bar,myplugin" }