GrapesJS Issues

3,464 parsed GitHub issues β€” 370 solved Β· 90 open. Search, filter and explore battle-tested answers.

231 issues found

πŸ” general
#3276Feb 18, 2021by ThomasPof2 answers
0 reactions

CleanId function not working with MJML code

This issue is about MJML code but I think this is more about grapesjs than grapesjs-mjml There is a function that remove unnecessary IDs in src/code_manager/model/HtmlGenerator.js. This function is working well on HTML tags, but not on MJML tags. What I found is

artf

https://github.com/artf/grapesjs/releases/tag/v0.16.41

GJSBlock

Thanks for reporting this, @ThomasPof. Thanks for sharing your report about CleanId function not working with MJML code. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle...

#3275Feb 18, 2021by confettidc2 answers
2 reactions

Limit the number of times of block to be dropped

Hi, Is it possible to limit the number of times of block to be dropped? e.g. the form block and be dropped once only. Thanks.

theSC0RP

Hi @confettidc, you can try doing something like, have a counter variable and update it once a block of a type is added and remove the newly added block if the counter condition is satisfied. Do check the API Reference.

GJSBlock

Thanks for reporting this, @confettidc. Great question about Limit the number of times of block to be dropped. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your spe...

#3274Feb 17, 2021by mig84472 answers
0 reactions

Block.js `initialize` function is not doing anything

https://github.com/artf/grapesjs/blob/3199d76ba5677229e90f13ef48fb91e9bfe1e90d/src/blockmanager/model/Block.js#L23 As far as I can see, the code in the initialize function tried to set the category as a new Category object but it currently doesn't do anything. And since the category part is taken care by the BlocksVie...

artf

yeap, seems like an old thing, thanks

GJSBlock

Thanks for reporting this, @mig8447. Thanks for sharing your report about Block.js initialize function is not doing anything. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSF...

#3273Feb 17, 2021by ThomasPof2 answers
0 reactions

REQUEST : Need a new release to have cleanId function

The grapesjs-mjml extension needs a newer version of grapes.js This commit is cleaning ids and grapesjs-mjml need it in order to produce valid MJML code. Can you provide a new release ? (the master version is 0.16.37 and the release is still 0.16.34) Thanks a lot ! :-)

artf

Done https://github.com/artf/grapesjs/releases/tag/v0.16.41

GJSBlock

Thanks for reporting this, @ThomasPof. Great question about REQUEST : Need a new release to have cleanId function. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

#3271Feb 16, 2021by Francos102 answers
0 reactions

SFTP

Hi, I have a question can the photos and videos we add in grapesjs be stored on a server using sftp?

artf

You can read more about how to handle asset upload here: https://grapesjs.com/docs/modules/Assets.html#uploading-assets

GJSBlock

Thanks for reporting this, @Francos10. Great question about SFTP. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener...

#3255Feb 1, 2021by Abhisheknanda13444633 answers
3 reactions

Custom Style Manager

Hi @artf I am trying to change the type and input values of display property like this way -: But on style-manager Button are not visible. How can we customize the display property Demo -: https://codepen.io/abhi_punk81/pen/MWbWzaq?editors=0010 Could you Please Help @artf ? Thanks

nilchu

You have to use the list property to define your options. Inside the radio option objects, it should read name instead of title. ```javascript const styleManager = editor.StyleManager; styleManager.addSector('div-only-sector', { name: 'Set...

Abhisheknanda1344463

Thanks A lot @nilchu for your help.

GJSBlock

Thanks for reporting this, @Abhisheknanda1344463. Great question about Custom Style Manager. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module L...

#3254Jan 29, 2021by alemenciones2 answers
0 reactions

How to hide ".gjs-traits-label" in traitManager?

maybe can you help me... i want remove the label ".gjs-traits-label" when traitManager's opened. i tried something like this:

artf

GJSBlock

Thanks for reporting this, @alemenciones. Great question about How to hide ".gjs-traits-label" in traitManager?. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your s...

#3251Jan 28, 2021by RutujaBadbe4 answers
0 reactions

How can I specify position of dropped element ?

I want to specify the position of dragging element. for example, if I have a header block which no matter where you drag, it should be placed at the top of document. how should I do that?

RutujaBadbe

after dropping the header block into the canvas, I need it to go at top of any other component/block. currently, I am doing this. but it is not working. editor.on('canvas:drop',(DataTransfer, model)=> { if (model.is('header')) { var index...

artf

You can use draggable property to define (via CSS query strings) where the component could be placed but you can't specify the position. You can try to create a custom component as a container for components like the header and init always...

RutujaBadbe

@artf thanks for the reply. I don't know if it is correct way but I did something and it worked for me. I am quite new at this and still learning from docs. I did this- editor.on('canvas:drop',( model)=> { if (model.is('header')) { //creat...

#3250Jan 28, 2021by fmay4 answers
2 reactions

Layer labels

@artf I am loving working with GJS. I have one last thing I'd love your help on. It would be incredibly helpful to be able to customise the labels in the layer manager. I've searched high and low but not found anything. The default way it just shows and is not very helpful when wanting to navigate efficiently. <img wi...

artf

You can extend the model of your component/s and overwrite the getName function

fmay

In case this is useful for anyone, I found an easy/alternative way of doing this when a component is created.

flauc

This is how I did it: The benefit is that if the components id or tag change later it will still be updated in the layer manager and you can also rename individual components.

#3249Jan 27, 2021by theSC0RP4 answers
0 reactions

QUESTION regarding JSON stored by the StorageManager

Hey, @artf. I want to access the json that is generated when a template is stored without actually storing the template. The json object can be accessed using the events but I don't want to call editor.store() and then use the events. Is there a way I can do get the json object (a function call on editor or some prope...

Joshmamroud

@theSC0RP Is this what you're looking for? editor.getComponents()

artf

@theSC0RP it's not clear if you want the storage functionality or not, but what proposed Josh is correct or you can always add your storage (and do nothing inside if need to...) https://grapesjs.com/docs/modules/Storage.html#define-new-sto...

theSC0RP

you can always add your storage (and do nothing inside if need to...) https://grapesjs.com/docs/modules/Storage.html#define-new-storage Thanks @artf. This is what I ended up doing. With editor.getComponents(), you get a cyclic structure st...

Browse all topics