GrapesJS Issues

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

829 issues found

🔍 question
#2936August 3, 2020by lavioros1 answer
5 reactions

QUESTION: Inline style loads on id instead of class

Hello, I have been using your tool for a while and I decided to upgrade to a newer version(from v0.12.37 to v0.16.3 + gjs-preset-newsletter). I have the styles stored inline, I know it is not desirable, but since we use the tool for authoring emails, it is still a safer option. Is there a way to load inline styles on...

artf

I'd suggest using this option

#2933August 3, 2020by megarg1 answer
0 reactions

QUESTION: Is there a way to listen to class name changes

I have created a added a component to the "view". I want to show this component only in view (and not add to model/html thus added to the view). I would like to pass any "class" assignments or changes to this component. For this, I need to listen to a event for any class assignments. Is this possible?

megarg

I figured it out -- using "update" local hook updated(property: any, value: any, prevValue: any) { for (let i = 0; i < value.models.length; i++) { log.debug('$$$$ :', value.models[i].attributes.name); } }, I am using " value.models[i].attr...

#2926July 28, 2020by Zero-Zheng1 answer
0 reactions

[Question] How to realize click hyperlink jump?

hi @artf I want to implement dynamic link jump in grapes JS, but I can't find an effective method. Can you help me?

artf

If for "hyperlink jump" you mean the anchor link, in that case, you have to append #IDELEMENT to the link, where IDELEMENT is the id of the element you want to point

#2924July 28, 2020by tomazkramberger2 answers
2 reactions

[QUESTION] Component HTML being changed

I am using GrapesJs to define Freemarker FTL templates. I am seeking an issue when my custom component HTML has been changed after inserted into canvas or imported through Import template component using newsletter plugin. So my original HTML content looks like: into which corrupts my template. Is there a way to bypas...

tomazkramberger

@tomazkramberger did you find a solution to this problem? @ShenolHusein Yes, i did. Here is the link to solution https://stackoverflow.com/questions/63475404/html-editor-removes-freemarker-tags-inside-table-tag

ShenolHusein

@tomazkramberger did you find a solution to this problem?

#2922July 27, 2020by RJCAM3 answers
2 reactions

[QUESTION]: Get all css without specific component and it's children

Hi, so, in this issue #2861 we can get all the css of a selected element and it's children with: But if I want to get all the css but without specific component and it's children or exactly the inverse of the above Is there a way to do this?

mcottret

Hi @RJCAM ! I don't think there's a built-in way to achieve this, but building on top of the answer you linked, you can recursively concatenate all the components' CSS, filtering out the selected one & its children like the following (assu...

mcottret

@RJCAM I'm sorry I just noticed that my previous answer wasn't working because retrieving the CSS of a component with children also included the children's CSS (it hence produced duplicated styles, as well as including the selected compone...

RJCAM

Hi @mcottret, thanks for your response I think your right, I'm going to edit your code to make it work as I expect I really appreciate your help, thank you!

#2920July 26, 2020by wfcheng3 answers
0 reactions

Question: Replace Rich Text Editor with summernote does not seem to work

I am trying to replace the default RTE in grapesjs with summernote. I got some help from the author of summernote and got this codepen to work somewhat, but the summernote author concluded that: But grapejs p element is a content in iframe. In other words, there is a structure where a p tag exists in an iframe and ui...

wfcheng

Made some more changes and now the summernote toolbar appears correctly but only bullet formatting works. The new codepen is here. @artf Any pointers would be greatly appreciated.

timramseyjr

@wfcheng Did you ever get anywhere with this? The codepen includes the canvas script/styles which adds the resources inside the iframe, so I was a little confused what summernote author was referring to.

wisecheng38

@timramseyjr I ended up just adding more buttons to the RTE toolbar to allow applying font styles and color on selected text, even though the grapesjs documentation recommends to use the style manager. I found that it is more user friendly...

#2897July 15, 2020by DRoet3 answers
0 reactions

[Question] help contributing to the mjml repository

Hi @artf I'm sure you are very busy these days, but I have been trying to reach out about helping move the grapesjs-mjml project forward. I know this is not the right repository to ask but I have higher hopes of reaching you here. I have several PRs open, see https://github.com/artf/grapesjs-mjml/pulls and I've contri...

artf

Yeah sure man, unfortunately, I can't focus on that plugin right now so your help is really appreciated

DRoet

No problem, I appreciate all the effort you put in so far, thanks for the invite

artf

DM me on twitter if you need my direct contact

#2894July 14, 2020by HeyWrecker3 answers
3 reactions

[Question]: How Do I Hide / Disable Dropzone in AM Modal

Hello, I've been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the Asset Manager Modal. In my config, I have set the upload attribute to 0, and yet the dropzone still appears, is clickable, displays the system file browser, and allows me to select...

mcottret

Hi @HeyWrecker ! As far as I know this is only possible by overriding the AM Modal's style like so: You can also see this issue regarding completely disabling image upload. Cheers !

HeyWrecker

@mcottret Hi Mathieu! Thanks for the advice! I'll try those steps out. I genuinely appreciate such a quick reply!

mcottret

I see, sorry for the misunderstanding :) I didn't know about this specific behaviour, but the assets from the loaded configuration might override the initial set value. You could try updating the assets list after loading the configuration...

#2893July 14, 2020by Hsin903211 answer
0 reactions

[Question] Can I set for loop value in components render?

Hi,I'm beginner in grapesjs. I want to make a question number by for loop when I dropped components, ↓I want final like this image. the div can show for loop number. ↓my component's code In render, I divided the my default html questionCom from {{i}} into front and back. then,put them in render. {{i}} can perfect to s...

artf

Use the questionCom you're passing to the model (use model to update model related logic) and I'd suggest using API from the Components documentation (eg. textType.view.extend is the old one)

#2891July 13, 2020by Davidvlv1 answer
1 reactions

[Question] Upgraded 0.15.3 => 0.16.18, saved JSON is not storing some properties

Hi, we upgraded from 0.15.3 to 0.16.18 and now the saved JSON coming out of grapesjs doesn't include some things that we were using before, namely styles and tagName. Before Upgrade (0.15.3): After Upgrade (0.16.18): As we don't use the HTML, only the JSON, we need those properties to be in the schema. Is there some c...

longdoan7421

Yes, there is. When init grapesjs, you could set the config avoidDefaults to false.