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.

All CKEditor configuration properties are documented in the online CKEditor configuration reference.

The final JSON configuration object of each HTML field is determined by three things:

  1. 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:

     

  2. 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.

  3. 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"
}
To debug the three-step merge of default, overlayed and appended JSON configuration, set the log level of org.onehippo.ckeditor.CKEditorConfig to DEBUG.
To debug the client-side configuration used by differents editors, open the JavaScript console of your browser and inspect the CKEDITOR.instances object. It contains a map of all CKEditor instances in the current page. CKEDITOR.instances.<editorId>.config contains the JSON configuration of a particular editor.
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?