voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 503 forks source link

Adding custom buttons at runtime to WYSIWYG (tincyMCE) editor via mosaico plugin #604

Closed evdmeer closed 3 years ago

evdmeer commented 3 years ago

I am working on adding functionality in the TinyMCE editor inside mosaico that requires custom buttons in the editor. The buttons are different for each different user etc, so they must be added at runtime.

The official way to do add a button to TinyMCE is to add them in the setup function during init().

Is there a way to add custom buttons at page load with only using a mosaico plugin and without making changes to the source? I have seen some comments on issues here on github that indicate that it should be possible, but so far I have not been able to get it to work.

I know I can change the wysiwyg.js file to include a call to a custom function that adds them, but I want to try to do it while changing as little source as possible, as every customization has the possibility to introduce unwanted problems.

bago commented 3 years ago

Have a look at those tickets:

178 #247 #239 #194

And this page about plugins: https://github.com/voidlabs/mosaico/wiki/Mosaico-Plugins