GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#3275February 18, 2021by confettidc1 answer
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.

#3274February 17, 2021by mig84471 answer
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

#3273February 17, 2021by ThomasPof1 answer
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

#3272February 17, 2021by ThomasPof3 answers
0 reactions

BUG: id are added to <img/> on double click on it

Version: 0.16.37 Are you able to reproduce the bug from the demo? [X] Yes [ ] No What is the expected behavior? It's about the GrapesJS-mjml plugin : this syntax doesn't accept id's on elements. But AssetsManager add ids to image elements. I would like to not add id attributes to <img> tags Steps to reproduceclone and...

ThomasPof

The id seems to be added way before opening the asset manager :clone and run the projectadd an image on the index.html fileinspect this image element : there is the id in the dom element

ThomasPof

Found a clue in /Users/thomaspopoff/Sites/grapesjs/src/code_manager/model/HtmlGenerator.js line 10, the opts.cleanId is always undefined. I don't know how to set it to true to remove auto-generated ids

ThomasPof

Ok sorry for all my self-talk : there is an option opts.cleanId inside getHtml() function you can configure to remove auto-generated ids...

#3271February 16, 2021by Francos101 answer
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

#3270February 15, 2021by haizenbergD1 answer
0 reactions

QUESTION: How to export JS code from angular components?

Hey, I am using grapesjs in my Angular app I have a custom angular component (which is basically custom HTML created with angular) and I am trying to export content using grapesjs-plugin-export Issue I am facing is that after export there is no JS code (which is initially inside angular component) that can do with htm...

artf

You can more about components with js here: https://grapesjs.com/docs/modules/Components-js.html#basic-scripts

#3269February 12, 2021by acondura3 answers
0 reactions

Translating html string

Great library! It meets all the requirements but one: website text translation. I've searched high and low through the issue queue and docs and for some reason I can't find anything about this subject. My clients do not care that the grapesjs editor is in English. What they want is the ability to easily translate thei...

artf

This is something you would need to create on your own. Maybe a custom text component, which gives the possibility to change the content with the selected language.

jordandevogelaere

@acondura do you have a solution for this? I have the same requirement for my client. Thanks

gxanshu

i have the same requirement too. and yes only way we can achive this is by creating our own component

#3268February 12, 2021by theSC0RP3 answers
0 reactions

QUESTION: How to add javascript in the html without sanitization?

Hey @artf, I am taking javascript input from the user. I need to add this javascript inside the template HTML but it gets sanitized. Is there a way that I can turn off the sanitization? (I don't have an issue with the problems you mentioned in #3245 ) or can you add a property in the editor like allowSanitization: fal...

theSC0RP

I tried adding the script to the iframe in which the canvas renders by adding a <script> tag at the end of the body of the iframe. This works to some extent. The problem here is that when I need to update the js inside the script I will ne...

artf

Can you provide a reproducible demo of your issue, please?

theSC0RP

Thanks for the reply @artf. I was doing a mistake while updating the iframe so now my problem is solved! Just another question, is there any built-in method to refresh the iframe?

#3267February 11, 2021by mosh-tudor3 answers
1 reactions

BUG: Cannot set 0px box shadow blur

For some reason, the editor does not allow to set the blur to 0px. 0 always magically turns into 5px. <img width="243" alt="Screenshot 2021-02-11 at 17 14 05" src="https://user-images.githubusercontent.com/668451/107664461-ba321e00-6c8c-11eb-91ce-4e8a87a2e33c.png"> Are you able to reproduce the bug from the demo? Yes...

artf

This one should already be fixed

artf

Thanks, I guess there is some falsy check with the 0 which leads to the default 5px value.

akankshach29

Would like to help fix this bug. Will raise a PR.

#3266February 9, 2021by amliu1 answer
0 reactions

[Question] How to know from which block is the selected component generated ?

Wondering how to do a reverse lookup, from component back to block. I use Block Manager add() to add a block like below after initialization. How do I if the selected component is generated by this custom block ?

artf

You should think more about components than blocks, indeed the right Block should look more like that. But in case you need it, you can always attach custom properties to your content block (which then will be appended to the component) On...