Expand my Community achievements bar.

SOLVED

I need help in creating a plugin for rich text editor in cq5 to add an image, pdf, video, ppt or any file into rich text editor.

Avatar

Level 1

Hi,

I need help in creating a plugin for rich text editor in cq5 to add an image, pdf, video, ppt or any file into rich text editor.

The existing rte plugins that are available are findreplace, undo, spellcheck, table etc

How to create a plugin to add a file to rich text editor?
The plugins are an ext js files. Appreciate if any one can suggest answer. It will be of great help.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

TO create a plugin

*    Create a custom clientlib and extend the CQ.form.rte.plugins.Plugin object
*    override in the implementing plugin following methods as per your need:
getFeatures() returns an array of all the features that the plugin makes available.
initializeUI() adds the new button to the RTE toolbar.
notifyPluginConfig() displays title and text when the button is hovered.
execute() is called when the button is clicked and performs the plugin action: it displays a window that is used to define the text to be included.
*    Registers is your plugin using CQ.form.rte.plugins.PluginRegistry.register
*    Then use your custom plugin in all your rte.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

TO create a plugin

*    Create a custom clientlib and extend the CQ.form.rte.plugins.Plugin object
*    override in the implementing plugin following methods as per your need:
getFeatures() returns an array of all the features that the plugin makes available.
initializeUI() adds the new button to the RTE toolbar.
notifyPluginConfig() displays title and text when the button is hovered.
execute() is called when the button is clicked and performs the plugin action: it displays a window that is used to define the text to be included.
*    Registers is your plugin using CQ.form.rte.plugins.PluginRegistry.register
*    Then use your custom plugin in all your rte.

Avatar

Level 1

Aalok Sarda wrote...

Hi,

I need help in creating a plugin for rich text editor in cq5 to add an image, pdf, video, ppt or any file into rich text editor.

The existing rte plugins that are available are findreplace, undo, spellcheck, table etc

How to create a plugin to add a file to rich text editor?
The plugins are an ext js files. Appreciate if any one can suggest answer. It will be of great help.

Thanks