How to extend Mautic GrapesJS to add custom blocks?

Hi,

basically the title. I want to extend GrapesJS and add custom blocks.

I guess, I need to create GrapesJS Plugins.

I read how I create a Mautic Plugin and how I create a GrapesJS Plugin.

I’m wondering: How would I add my plugin to the GrapesJS editor instance?

I found the topic FYI custom code block for grapesjs works good so far - instructions to add, but it suggests editing the code of the grapesJS plugin.

This seems odd. Is there another way? How would my JS code get access to the grapesJS instance/var to register the plugin and/or components?

Hints for M4/M5 highly appreciated.

Kind regards

1 Like

As far as I know you will have to extend GrapeJS plugin by modifying the code of the grapeJS plugin.

You can make an effort to add customizations into your own files, but at the end you will have to import those files and register everything in at least one core JS plugin file.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.