Mentor:
Chris Maiden - https://github.com/matason
Author:
Edit Olah - https://github.com/edit-olah
Aim: Users can click a button in the WYSIWYG editor’s toolbar and inject specific markup with clickable areas where they can input content.
Folder structure:
- d --| sites
- d ------| all
- d ----------| modules
- d --------------| custom
- d ------------------| custom_wysiwyg
- d ----------------------| plugins
- d ---------------------------| accordion
- d --------------------------------| icons
- -------------------------------------| accordion.png
- --------------------------------| plugin.js
- ---------------------------| accordion.inc
- ----------------------| custom_wysiwyg.info
- ----------------------| custom_wysiwyg.module
The above inserts only the description list wrapper and the first element of the accordion. To keep things simple, we created a separate plugin, and therefore a separate button, for inserting additional accordion elements into the accordion.
Find it in this gist: accordion element: https://gist.github.com/edit-olah/63fcd10a7315499ef6e0