How to add a custom button in rte plugin in aem/cq

5.8k views Asked by At

How to add a custom button in rte plugin/cq?

The below path is for hyperlink

/apps/cq/ui/widgets/source/widgets/form/rte/plugins/LinkDialog.js

I need to add a custom button in rte plugin to extend the hyperlink functionality?

1

There are 1 answers

0
iAMintoAEM On

To provide a new button/plugin in RTE, a new clientlib will have to be created. In the js file, the intended functionality of button can be implemented in ExtJs. In CSS file, the appearance/image of thee button can be specified.

Then the newly created clientlib can be registered as a plugin for RTE by using following line :

CUI.rte.plugins.PluginRegistry.register("pluginName",ClientlibName.PluginName.Plugin);

The entire process has been described step by step in this excellent article.