Grapesjs: Importing Basic Blocks

Created on 6 Nov 2019  路  5Comments  路  Source: artf/grapesjs

Hi guys,

I am building a project using grapesjs editor and I want to enable user to build his website easily using the editor. To do so I want as much as blocks avaiilable by deafult to help him do so. Whatever I'll is not there I am planning to build them by myself. So there are basically Presets for the grapesjs and each of them have their own set of blocks with some common in them. I want to import all them in my project.

So is there a way to do so ?

Thanks in advance.

All 5 comments

Hi there! you can specify the list of plugins you want:

  var editor = grapesjs.init({
      container : '#gjs',
      plugins: ['plugin-name-1', 'plugin-name-2'],
 });

cheers!

Hi there! you can specify the list of plugins you want:

  var editor = grapesjs.init({
      container : '#gjs',
      plugins: ['plugin-name-1', 'plugin-name-2'],
 });

cheers!

Hi pouyamiralayi,
I tried your approach but it didn't worked. When i try to import GrapesJS Newsletter Preset I am getting 14 of the blocks and on importing GrapesJS Preset Webpage I am getting 9 blocks, but on importing both of them I am still getting just 14 blocks and not all of them. Also not able to import GrapesJS MJML blocks . Is there anything I am doing wrong or any other approch you might know ?

@adityaMurarka i see the problem, i guess there are some conflicts when they all gather together!
leaving aside mjml here is what i did (it only drops a few items):

plugins: [
            'gjs-preset-newsletter',
            'gjs-preset-webpage',
        ],

please notice the order of the items, also i tried to include mjml but it seems it overwrites the others! please consider adding the [BUG] word to the issue title.

@adityaMurarka i see the problem, i guess there are some conflicts when they all gather together!
leaving aside mjml here is what i did (it only drops a few items):

plugins: [
            'gjs-preset-newsletter',
            'gjs-preset-webpage',
        ],

please notice the order of the items, also i tried to include mjml but it seems it overwrites the others! please consider adding the [BUG] word to the issue title.

@pouyamiralayi Thank You so much for your help !!.
It worked for both of the plugins.
@artf Can you help with the MJML preset plugin.

@adityaMurarka MJML plugin uses a custom renderer, it doesn't make sense mixing its blocks...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tribulant picture tribulant  路  3Comments

faizansaiyed picture faizansaiyed  路  3Comments

Geczy picture Geczy  路  3Comments

ryandeba picture ryandeba  路  3Comments

FlashPapa picture FlashPapa  路  3Comments