SunEditor
Recently, I stumbled upon SunEditor, which the author describes as “Pure javascript based WYSIWYG HTML editor, with no dependencies”. You can play with an example here. It seems to work really well and has a simple API that allows you to build plugins to your heart’s desire. The documentation and plugin examples are pretty good as well.
Integrating SunEditor with AEM
Since I liked it very much, I decided to build an integration for it with AEM. It turned out to be extremely simple! SunEditor starts with a <textarea> and initializes the editor around it. Additionally, the editor saves the HTML value into the <textarea>making Sun ideal as an AEM dialog widget!
I’ve created a simple project on Github, that you can deploy and test for yourself: https://github.com/ahmed-musallam/AEM-SunEditor
Once you have it deployed to your AEM instance and have a component dialog that uses it, you should see something like this:
The editor allows you to edit almost everything the AEM RTE allows you to. It even allows you to author in full screen!
The editor does not support adding/authoring AEM images, but integrating that with AEM should not be difficult since SunEditor does support images. But that might be for a later post. For now, test this out and let me know how you like it!
No comments:
Post a Comment
If you have any doubts or questions, please let us know.