Search code examples
kentico

Kentico13 - How to add customize links in CKEditor using Kenticos "Insert Link" dialog


We are using Kentico XP 13.0.44. Our content editors create news articles with rich text fields in built-in CKEditor v4.14.

Our editors ask for a feature to add buttons within the rich text: Basically, a link where they can define a label and a link target but that comes with predefined mark-up/CSS styles (predefined by developers).

I started to create a custom CKEditor plugin and, ideally, content editors could select the link target using Kentico's "Insert Link" dialog 1. This dialog is called and processed in CKEditor plugin "CMSPlugins".

Is it possible to somehow adapt/use this dialog in my own CKEditor plugin? Or what could be the best way to tackle this request?

enter image description here


Solution

  • The simplest, lowest code, solution is to add a custom style to the style selector already in place. Let the user use the already built-in link creator/selector, then from the "Styles" dropdown, select the "button" style you want to apply to the <a> tag.