Skip to content

mendixlabs/CKEditorForMendix

Repository files navigation

CKEditor for Mendix Support

This widget gives you a full version of the CKEditor with an extra button that allows you to create microflow links inside your HTML output.

test

Current CKEditor version: 4.10.0

Contributing

For more information on contributing to this repository visit Contributing to a GitHub repository!

Typical usage scenario

Use this widget to add a full WYSIWYG editor for your entity attributes. This version has the ability to add links to HTML that can run microflows when clicked uppon.

Description

The CKEditor widget comes with the CKEditor viewer. This viewer will enable the posibility to reformat links to microflow links.

  • The viewer needs an entity and attribute where it can get the HTML code.
  • You can style the link as a button or just text.
  • Within the CKEditor widget configure labels that can be placed with the mendix link button.
  • These labels can be configured in the viewer to execute a microflow.
  • The microflow will get the entity from the viewer widget.

Example of the entire editor

test

Example of the end result in mendix.

test

Example of someone clicking the button.

test

Images

The CKEditor comes with two modes to handle images:

  • Paste them as a base64 string (Inline images)
  • Upload them to Mendix

You can set this mode using the 'Images' tab in your widget configuration in the Modeler

images

Mode 'Upload'

  • Make sure the Entity is inherited from System.Image. You can use a reference, in that case the context will set references to the uploaded images.
  • You can set an XPath constraint on the images in the Image browser that you can reach in the CKEditor by clicking imagebrowser. This Image browser is only enabled when you have set Mode to 'Upload' and added an Entity
  • Upload only works when you drag an image from your explorer (for example Windows Explorer) directly in the editor (so Copy + Paste does not work due to browser inconsistensies)

Behaviour

The widget has a few options that you can set as default behaviour in the CKEditor

behaviour

  • Entermode: Default behaviour for the editor when pressing Enter. This is Paragraph by default
  • Shift-Entermode: Default behaviour for the editor when pressing Shift + Enter. For example, in Word, when you are working in a list and you want to add an extra rule to your list-item, you use Shift+Enter. By default this should be BR.
  • Autoparagraph: It is recommended to leave this to true. In the CKEditor you can turn it off, but it is not recommended.

Embedding

The widget supports embedding of video's. This can be used by clicking imagebrowser. It will automatically create an embed code when you enter the url of the a video (for example YouTube or Vimeo). For more details on what is supported, please see the plugin page