CKEditor Plugins

CKEditor supports a wide range of plugins that extend its core functionality. Each plugin is identified by a unique, lowercase name, which you reference in the CKEditor configuration.

Table of Contents

Available Plugins

Bloomreach Content includes the following CKEditor plugins by default:

PluginDescriptionUsed by default in Formatted Text Fields inUsed by default in Rich Text Fields inAvailable since release
ContentChannelsContentChannels
a11yhelpAccessibility HelpNoNoYesYes10.0
aboutAbout CKEditorNoNoNoNo10.0
autogrowAuto GrowNoYes [2]NoYes [2]12.0
autolinkAuto LinkNoNoYesYes13.1
balloonpanelBalloon PanelNoNoNoNo12.0
balloontoolbarBalloon ToolbarNoNoNoNo12.5
basicstylesBasic StylesYesYesYesYes10.0
bidiBiDi (Text Direction)NoNoNoNo10.0
blockquoteBlockquoteNoNoNoNo10.0
buttonUI ButtonYesYesYesYes10.0
clipboardClipboardYesYesYesYes10.0
codemirrorCodeMirror (Source) Syntax HighlightingNoNoYesYes10.0
codesnippetCode SnippetNoNoNoNo10.0
colorbuttonColor ButtonNoNoNoNo10.0
colordialogColor DialogNoNoNoNo10.0
copyformattingCopy FormattingYesYesYesYes12.0
contextmenuContext MenuYesYesYesYes10.0
dialogDialogYesYesYesYes10.0
dialogadvtabAdvanced Tab for DialogsNoNoYesYes10.0
dialoguiDialog User InterfaceYesYesYesYes10.0
divDiv Container ManagerNoNoNoNo10.0
divareaDiv Editing AreaYesYesYesYes10.0
elementspathElements PathNoNoYesYes10.0
emojiEmojiNoNoNoNo13.1
enterkeyEnter KeyYesYesYesYes10.0
entitiesEscape HTML EntitiesYesYesYesYes10.0
fakeobjectsFake ObjectsNoNoNoNo10.0
filebrowserFile BrowserNoNoNoNo10.0
findFind / ReplaceNoNoNoNo10.0
floatingspaceFloating SpaceYesYesYesYes10.0
floatpanelFloating PanelYesYesYesYes10.0
fontFont Size and FamilyNoNoNoNo10.0
formatFormatNoNoNoNo10.0
forms [1]Form ElementsNoNoNoNo10.0
hippoautosaveBloomreach Content auto saveYesYesYesYes10.0
hippopickerBloomreach Content pickers for images and internal linksNoNoYesYes10.0
horizontalruleHorizontal RuleNoNoNoNo10.0
htmlwriterHTML Output WriterYesYesYesYes10.0
iframeIFrame DialogNoNoNoNo10.0
iframedialogIframe Dialog FieldNoNoNoNo13.4
imageImageNoNoNoNo10.0
image2Enhanced ImageNoNoNoNo10.0
indentIndent / OutdentNoNoYesYes10.0
indentblockIndent BlockNoNoYesYes10.0
indentlistIndent ListNoNoYesYes10.0
justifyJustifyNoNoYesYes10.0
languageLanguageNoNoNoNo10.0
linkLinkNoNoYesYes10.0
listListNoNoYesYes10.0
listblockList BlockYesYesYesYes10.0
liststyleList StyleNoNoYesYes10.0
magiclineMagic LineYesYesYesYes10.0
mathjaxMathematical FormulasNoNoNoNo10.0
maximizeMaximizeNoNo [3]YesNo [3]10.0
mentionsMentionsNoNoNoNo13.1
menuMenuYesYesYesYes10.0
menubuttonMenu ButtonYesYesYesYes10.0
notificationNotificationNoNoNoNo10.2
pagebreakPage BreakNoNoNoNo10.0
panelPanelYesYesYesYes10.0
panelbuttonPanel ButtonYesYesYesYes10.0
pastefromwordPaste from WordNoNoYesYes10.0
pastetextPaste as Plain TextNoNoYesYes10.0
placeholderPlaceholderNoNoNoNo10.0
popupPopupNoNoYesYes10.0
removeformatRemove FormatYesYesYesYes10.0
resizeEditor ResizeNoNo [3]YesNo [3]10.0
richcomboRich ComboYesYesYesYes10.0
selectallSelect AllNoNoNoNo10.0
sharedspaceShared SpaceNoYes [2]NoYes [2]12.0
showblocksShow BlocksNoNoYesYes10.0
showbordersShow Table BordersNoNoYesYes10.0
smileyInsert SmileyNoNoNoNo10.0
sourceareaSource Editing AreaNoNo [3]NoNo [3]10.0
sourcedialogSource DialogNoYes [2]NoYes [2]12.0
specialcharSpecial CharactersNoNoYesYes10.0
stylescomboStyles ComboYesYesYesYes10.0
tabTab Key HandlingYesYesYesYes10.0
tableTableNoNoYesYes10.0
tableresizeTable ResizeNoNoYesYes10.0
tableselectionTable SelectionNoNoYesYes12.0
tabletoolsTable ToolsNoNoYesYes10.0
templatesContent TemplatesNoNoNoNo10.0
textselectionKeep TextSelectionNoNoYesYes10.0
toolbarEditor ToolbarYesYesYesYes10.0
undoUndoYesYesYesYes10.0
widgetWidgetNoNoNoNo10.0
wordcountWord Count and Character CountNoNoNoNo10.0
wysiwygareaIFrame Editing AreaNoNoNoNo10.0
youtubeYouTube PluginNoNoYesYes10.0
  1. The 'forms' plugin requires CKEditor to run in an iframe instead of a div. Refer to the example configuration for setup instructions.
  2. Explicitly enabled by the system.
  3. Explicitly disabled by the system.

Info:
All plugins are available in both Content and Channels, except for a few that are explicitly disabled in Channels:

  • The maximize plugin is replaced by the "full width toggle" in the right side-panel.
  • The sourcearea plugin is not compatible with the inline version of CKEditor, so Channels uses the sourcedialog plugin instead.
  • The resize plugin does not work with the inline version of CKEditor, so Channels uses the autogrow plugin instead.

Runtime Debugging

You can retrieve the list of available plugins at runtime:

  1. Log in to Bloomreach Content using Chrome or Firefox.
  2. Edit a document type that includes an HTML field.
  3. Open Chrome DevTools or Firebug.
  4. Run the following JavaScript to list all registered plugins:
    Object.keys(CKEDITOR.plugins.registered).sort()

To inspect the plugins used by a specific editor instance:

  1. Print the map of all CKEditor instances to identify the editor instance name:
    CKEDITOR.instances
    
  2. List all plugins for a specific instance (for example, 'editor123'):
    Object.keys(CKEDITOR.instances.editor123.plugins).sort()
    

Add an Existing CKEditor Plugin

To enable a CKEditor plugin already included in Bloomreach Content, set the [extraPlugins](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins) configuration property. For example, to add the 'About' plugin:

ckeditor.config.overlayed.json:

{
  extraPlugins: 'about'
}

Some plugins add buttons to toolbar groups that are not shown by default. In this case, also add the relevant toolbar group. For example, to display the 'About' button in rich text fields, add the following configuration:

ckeditor.config.appended.json:

{
  toolbarGroups: [
    { name: 'about' }
  ]
}

Remove an Existing CKEditor Plugin

To disable a CKEditor plugin that is enabled by default, use the [removePlugins](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-removePlugins) configuration property. For example, to remove the 'stylescombo' plugin:

ckeditor.config.overlayed.json:

{
  removePlugins: 'stylescombo'
}

Add a Custom CKEditor Plugin

You can package custom CKEditor plugins in any .jar file included with the 'cms' application in your project. The recommended approach is to add them directly to the 'cms' artifact.

Place the source code for custom CKEditor plugins under:

src/main/resources/ckeditor/plugins/

Create a subdirectory for each plugin, using the plugin name as the directory name. Each plugin must include a main plugin.js file, and may include additional files or icons as needed.

In production, the CMS loads an optimized version of CKEditor sources from src/main/resources/ckeditor/optimized. You should also provide an optimized version of your custom plugin in this directory. For small custom plugins, copying the source files using the Maven resources plugin is sufficient (see the example below).

Info:
In Wicket development mode, the CMS loads the plain CKEditor and plugin sources. In Wicket production mode, it loads the optimized sources. Develop custom plugins in Wicket development mode and use a tool like JRebel to hot-deploy your changes.

Info:
Starting with brXM 11, you must explicitly include CKEditor sources when building your project. Set the system property include.ckeditor.sources:

mvn clean verify -Dinclude.ckeditor.sources

This approach reduces the size of production WAR files by excluding unused CKEditor sources.

Hint:
For guidance on developing CKEditor plugins, see the CKEditor plugin SDK documentation. If your plugin adds HTML elements, update the HTML cleaning configuration to support them. Review the advanced content filter integration and update the server-side HTML cleaner configuration as needed.

Example: Timestamp Plugin

The CKEditor developer's guide provides an example plugin called 'timestamp'. To add this plugin to a project created from the archetype, follow these steps:

  1. Download the source code and copy the tutorial-timestamp/timestamp directory into cms/src/main/resources/ckeditor/plugins. The resulting structure should be:

    cms/
        src/
            main/
                resources/
                    ckeditor/
                        plugins/
                            timestamp/
                                icons/
                                    timestamp.png
                                plugin.js
    
  2. To provide an optimized copy of the sources, add the following to the build/plugins section of cms/pom.xml:

    <build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>create-optimized-resources</id> <phase>generate-resources</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/classes/ckeditor/optimized</outputDirectory> <resources> <resource> <directory>${basedir}/src/main/resources/ckeditor</directory> </resource> </resources> </configuration> </execution> </executions> </plugin> ... </plugins> </build>
  3. Build and start the project:

    mvn clean verify
    mvn -Pcargo.run
    
  4. Log in to the CMS as 'admin' and edit the 'newsdocument' type in the document type editor (Documents > Configuration > myproject > newsdocument > Edit).

  5. Select the 'Body' field and add the 'timestamp' plugin to the overlayed CKEditor configuration:

    ckeditor.config.overlayed.json:

    {
      extraPlugins: 'timestamp'
    }
    

The 'timestamp' icon should now appear in the toolbar for the 'Body' field editor.

For more information about creating CKEditor plugins, see the Simple CKEditor Plugin Tutorial.

CKEditor Plugin That Opens a Wicket Dialog

You can create a custom CKEditor plugin that opens a Wicket dialog in Bloomreach Content. This requires:

  1. A CKEditor plugin for client-side logic and UI.
  2. A custom CKEditorNodePlugin Java class that creates a CKEditorPanel with an additional CKEditorPanelExtension.

The 'hippopicker' plugin is an example. It adds 'image' and 'internal link' buttons that open Bloomreach Content pickers (Wicket dialogs). Each CKEditor field is rendered by the CKEditorPanel class. The default CKEditorNodePlugin adds the server-side Wicket behavior for the hippopicker plugin to the CKEditorPanel. To add your own server-side behavior, extend CKEditorNodePlugin. First, add the following dependency to your CMS pom.xml (or to another artifact included in the CMS WAR):

<dependency> <groupId>org.onehippo.cms7</groupId> <artifactId>hippo-cms-richtext-ckeditor-frontend</artifactId> </dependency>

Override the createEditPanel method in your custom plugin class and add a CKEditorPanelExtension:

public class MyCKEditorNodePlugin extends CKEditorNodePlugin { @Override protected CKEditorPanel createEditPanel(String id, String editorConfigJson) { CKEditorPanel panel = super.createEditPanel(id, editorConfigJson); panel.addExtension(new MyCKEditorPanelExtension(...)); return panel; } }

Implement MyCKEditorPanelExtension to add Wicket behaviors for your picker and provide the Ajax URL to the editorConfig JSON object. The client-side plugin can use this URL to open the server-side picker. The server-side can render JavaScript to invoke a CKEditor command when the picker closes.

To use your custom plugin class, update the plugin class property:

/hippo:namespaces/hippostd/html/editor:templates/_default_/root
- plugin.class = org.example.MyCKEditorNodePlugin

Visual Editor

Plugins that open Wicket dialogs cannot be used in HTML fields in the Visual Editor. Ensure your plugin only initializes when the editor is loaded in a Wicket context:

CKEDITOR.plugins.add('mywicketbasedplugin', { init: function (editor) { if (window.Wicket) { // initialize plugin } } }

Alternatively, avoid using Wicket. For example, implement your plugin using CKEditor UI widgets and call a custom REST API by creating a repository JAX-RS service.

Share Feedback
Page: /build/document-types/html-fields-rich-text/ckeditor-plugins
Section: Build
Category *