View on GitHub

CoreMedia CKEditor 5 Plugins

CoreMedia's CKEditor 5 Plugins provides plugins for CKEditor 5 with focus on integration into CoreMedia CMS.

Download this project as a .zip file Download this project as a tar.gz file

Content-Link Feature

API Documentation

CoreMedia CMS manages its resources in so-called Contents, where each Content may either be a Document or a Folder.

The Content-Link Feature adds transparent support to CKEditor’s Link Feature by especially extending LinkFormView to be able to hold references to Contents.

Integration

Top Integration Design RichText
import LinkTarget from "@coremedia/ckeditor5-coremedia-link/contentlink/ContentLinks";

ClassicEditor
  .create(document.querySelector("#editor"), {
    plugins: {
      // ...
      ContentLinks,
    },
    // ...
  })
  .then(...)
  .catch(...);

Service Agent

Top Up Service Agent

To resolve the name and other properties of a linked content, the Content-Link feature uses the Service Agent architecture as introduced in context of CoreMedia Studio. This also applies to Drag and Drop support of contents into LinkFormView or directly into the text.

This requires the client integrating CKEditor with Content-Link feature to implement some required interfaces and register them at the service agent:

You will find these interfaces in @coremedia/ckeditor5-coremedia-studio-integration.

For integration into the example application mocks may be registered as provided by @coremedia/ckeditor5-coremedia-studio-integration-mock.

Design

Top Integration Design RichText

Representation for Root-Folder

While in general it is expected, that folders are not allowed to be referenced within standard RichText properties, clients like Studio-Client can be configured, to allow links to folders — including the root folder.

The root-folder, though, is the only content, which has/may have an empty name, which again provides a challenge when a name is required for editing purpose.

In context of the Content-Links feature, we decided:

If we experience the need to officially support links to root-folder these decisions are subject to change.

CoreMedia RichText 1.0 Integration

Top Integration Design RichText

For easier integration with CKEditor’s Link Feature it is required, that content-links are represented in href attribute with content: scheme syntax:

<a href="content:42">Some Content</a>

This requires:

In context of CoreMedia Studio, you may expect, that the REST backend already transformed more verbose content URIs from coremedia:///cap/content/42 to a shorter form: content/42. Thus, data-processing just needs to replace the slash by a colon.