Page tree
Skip to end of metadata
Go to start of metadata

Abstract

Rich text field must be able to handle images from both regular img links and from Magnolia assets. CKEditor does provide handling of regular img links and the goal of this concept is to describe how to implement references to assets app. Pattern used here follows the one used in links with external and Magnolia pages.

Goal

Add asset button to rich text field toolbar next to image button.

This button would launch choose asset dialog:

After choosing selected image will be embedded to rich text field content.

Otherwise the behaviour is analogous to linking. Double clicking and context menus will behave like normal CK workflow replacing CKEditor's image dialog with Magnolia asset dialog depending on context.

As a reference to CKEditor's image dialog looks like this:

Implementation

Data storing should be compatible with M4.5. Will need to investigate how data is stored and if it's necessary not to do so.

New plugin has to be created to CKEditor to handle new button and content. Common functionality with linking needs to be shared.

  • No labels

1 Comment

  1. I have a couple of questions and remarks on this:

    • Is there no way to call the "Choose asset" dialog from within the image dialog?
      I assume this dialog is opened, if you click on the image icon. Wouldn't it be neat if we could choose to either link an external image there or link an asset from the DAM?
    • Likewise for the links: has CK editor 4 changed in a way that would allows us to integrate the "M" icon with the "add link" function again?

    As a note, more to myself than for you (smile): yes, you would open that "Choose asset" dialog and we probably keep that dialog the way it currently works, maybe we have to style it a bit still. But ultimately, what should be shown there is the standard Chooser UI dialog of a content app. We introduced this custom dialog, because the Chooser UI doesn't allow you to browse folders while in Thumbnails view. I wouldn't mind this for 5.0 actually, because the Chooser UI does have the advantage of offering three different views plus search to choose the image you're looking for. But a change from the "Choose asset" dialog to a Chooser UI dialog would have to be properly discussed first in product management.