Tinymce add custom button on Voyager

82 views Asked by At

I have to create a custom button on my TinyMCE editor on Voyager, but its not working,

Here is my code:

function tinymce_setup_callback(editor)
{
    console.log("loaded");
    editor.ui.registry.addButton('customInsertButton', {
        text: 'My Button',
        onAction: function (_) {
          editor.insertContent('&nbsp;<strong>It\'s my button!</strong>&nbsp;');
        }
      });
}

I am sure this code can be executed, but not working.

I tried a lot of different stuff, but I have no ideas anymore.

0

There are 0 answers