SKLINET / strapi-plugin-tinymce

11 stars 18 forks source link

How to add custom functionality? #31

Closed DominikProbst closed 1 year ago

DominikProbst commented 1 year ago

Hi there, thanks for the plugin! I tried to add a simple testButton in the toolbar, but it doesn't work. I followed the documentation but nothing happens.

This is my plugins.js:

module.exports = () => ({
    tinymce: {
        enabled:true,
        config: {
            editor: {
                editorConfig: {
                    language: 'de',
                    plugins: 'lists link',
                    menubar: false,
                    toolbar: 'bold italic bullist numlist blockquote alignleft aligncenter alignright link hr removeformat testButton',
                    setup: function (editor) {
                        editor.ui.registry.addButton('testButton', {
                            text: 'testButton',
                            tooltip: 'testButton',
                            onAction: (_) => alert('hi'),
                        });
                    }
                }
            }
        }
    }
});
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

josh-atkins commented 1 year ago

@DominikProbst did you find a solution to this?

DominikProbst commented 1 year ago

@josh-distudios Hi, yes. I forked the repo and changed it directly in the code

josh-atkins commented 1 year ago

Cheers!