GrapesJS Issues

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

829 issues found

🔍 question
#2254September 9, 2019by eltoredoNo answers
0 reactions

[QUESTION] New command with a header runs itself?

Hello, I would like to ask wether my code is ugly and makes my localhost version do something bad or I'm not using the commands add correctly. To be more accurate, wherever I put the 'header index.php', even in an event that shouldn't be executed by itself, I will still be headed to index.php whenever I go on my grape...

#2251September 7, 2019by Ramkumar-Murugesan1 answer
0 reactions

adding Traits properties in canvas body[QUESTION]

Hi, I know that we add the traits options or properties for any component blocks. but I don't know how to add the traits for canvas body. can anyone please help me. In the above image. under the settings options. I need to add one input and radio button.

artf

You can add them at run time https://grapesjs.com/docs/modules/Traits.html#updating-traits-at-run-time

#2246September 6, 2019by parmando3 answers
0 reactions

[QUESTIONS] how do I change the "Layer" in text shadow?

Hello, how do I change the "Layer" in text shadow. I need to translate this ... Thank you

ghost

I do not think you can do that... but you can change the html of the page when the style is added or updated using jquery or javascript. Like replace(/Layer/g, 'Other') in editor update.

parmando

This is interesting ... but I can't implement it in practice.

parmando

Eu não acho que você pode fazer isso ... mas você pode alterar o html da página quando o estilo é adicionado ou atualizado usando jquery ou javascript. Como replace(/Layer/g, 'Other')na atualização do editor. How can I do this? It would be...

#2241September 4, 2019by adriangroch1 answer
0 reactions

[QUESTION] Is this the expected behaviour of the RichTextEditor?

When the rte section of the editor config is defined, I'm assuming that the defined default actions should reflect the actions array: Meaning that this should should only render the bold action Instead all default actions are instantiated: 'bold', 'italic', 'underline', 'strikethrough', 'link' See: https://codesandbox...

artf

mmm wrong key in docs... it should be thanks for the report

#2239September 3, 2019by Ramkumar-Murugesan1 answer
1 reactions

script interpolation for object [QUESTION]

Hi guys, has I know that we use external string values in script function by assigning the variable with value in custom triats. but I tried to pass the object or array. I didn't get the correct values. i really stuck on it can anyone please help me. my traits:- screenshots in the above screenshot. myModelCount value...

artf

@Ramkumar-Murugesan objects/arrays are not supported yet, we'll add them in the next release. For now, if you need an object/array in the script, create another property with a JSON.stringify version of the original (set a listener on orig...

#2238September 2, 2019by abozhinov3 answers
1 reactions

[QUESTION] How to get style for header & footer components only

Hi @artf, can you please tell me what is the fastest and easies way to extract component styles. I have template and in this template you can edit part of header, footer and add content between them. I don't store the whole template just the content in the middle, header & footer. component structure is easy I loop th...

abozhinov

I don't see a problem with media queries. The rules are detected by selector and everything works fine. I add class and set style only for mobile and it works.

artf

Yeah, styles are in a different container (editor.CssComposer.getAll()) so it's a bit harder and there is no API for extracting all matching styles. What I'd suggest doing something like this BTW this is not a final solution, definitely, y...

abozhinov

@artf, thanks!

#2237September 2, 2019by gabd14112 answers
1 reactions

[QUESTION] General editor updates using editor.on('update') event

Hi! Is there a way to get general, last editor updates using editor.on('update') event? Something like this: editor.on('update', e => { // get the event // get the specific, recent updates (HTML and CSS) })

olgertpysqyli

Hello. You can declare variables for html, css and js and their value is going to get updated every time when editor change event is triggered. change() {     this.html = editor.getHtml();     this.css = edito...

gabd1411

I've found another available event, editor.on('change'), but it seems difficult to read the HTML and CSS updates from this event

#2236September 2, 2019by makkaronis4e1 answer
0 reactions

[QUESTION] Replace all default icons

Is there any way to replace all default icons with SVG? I know that it is in roadmap, but maybe there is a way how can we do it now manually?

artf

Default icons are applied via classes so the only way is not to use them and add a custom SVGs inside the target element. BTW the current active issue about this is here #644

#2234August 30, 2019by arievanden3 answers
0 reactions

I/O operations with PHP/MySQL - I'm stuck

Hello and thank you for GrapesJS. It's awesome. I do have a question that I haven't been able to find an answer to. I'm using PHP/Yii and MySQL db. Your example for external storage config:storageManager: { type: 'remote', urlStore: 'http://endpoint/store-template/some-id-123', urlLoad: 'http://endpoint/load-template/...

smik3

Is there any reason why you can't use PHP to save it directly as a JSON file rather than on the database?

arievanden

I probably could, but we need to saved to DB. I'm OK, a developer figured it out for me, but it would be great to have some more detailed code examples for use with php/mySQL. Your docs are great, but this would be a nice addition to your...

artf

My problem is that I'm trying to get the HTML to JSON conversion formatted properly GrapesJS, by default, generates 4 types of data: HTML, CSS, Components (JSON from HTML), Styles (JSON from CSS) So you shouldn't do any kind of conversion....

#2232August 29, 2019by jeff-panart2 answers
0 reactions

[Questions] Video block missing settings

Hi, Locally installed GrapesJS and the addon 'preset-webpage', which gets me a basic layout with some blocks. One of those blocks is the video block. I can drag&drop a video on the canvas, but am not able to set a youtube url. In the demo I see, in the right sidebar, a Settings option. I'm missing that one in my insta...

artf

No, the video component is part of the core, so if do this editor.addComponents({ type: 'video' }) even without any plugin you should see the video traits correctly

jeff-panart

Hi artf, Hmz, then I think I did something else wrong.. adding the editor.addComponents line, doesn't make any difference. In my index.php I only have a div with gjs as id, and here I also call some assets (stylesheet and grapesjs script f...