GrapesJS Issues

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

3464 issues found

#633December 13, 2017by HarshOB2 answers
1 reactions

Give 'id' OR 'class' to traits

Is it possible to give 'id' or 'class' to traits, Like if I use select trails and I want to give 'id' to select HTML tag so I can perform events.

artf

Check here https://github.com/artf/grapesjs/issues/589

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#632December 13, 2017by volgan2 answers
0 reactions

Import HTML with file css

Could I use the tag link (example the bootstrap css link or my theme link) and style when I import HTML to grapejs?

artf

@volgan sure #27

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#631December 12, 2017by z1lk2 answers
1 reactions

How to refresh Classes view for active Component in the Style Manager

I'm using a trait (type=select) to change the class of a component (a "column" component, so classes representing width 1-12). After I have removed previous col-* classes and added the newly selected one (via a function triggered by the select change), the Classes section of the Style Manager still has the old class....

z1lk

Ah. The ClassTagsView (classes section of the style manager) updates the selector list on the event "change:selectedComponent" on the editor model. https://github.com/artf/grapesjs/blob/66c19dae4ff5536a34b9ea73d3614fc76752a77c/src/selector...

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#630December 12, 2017by kkuksin2 answers
0 reactions

(question) Is it possible to set categories dinamically?

Thanks for your component, I like it very much. I have some dinamic blocks (I have tabs and when I change tab, I add group of blocks and remove the other group of blocks. The issue is that when I remove old blocks, I can't remove their categories. If I remove their categories with js ( document.querySelectorAll('.gjs-...

artf

@kkuksin you don't need to remove blocks/categories, you should just rerender blocks. We discussed about blocks and tabs here #499

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#629December 11, 2017by krunal0393 answers
0 reactions

traits sometime does not fire event

sometime traits change event does not fire event on model and view and I have seen below error for that. Uncaught RangeError: Maximum call stack size exceeded. at HTMLDivElement.<anonymous> (grapes.min.js:9229) at o (grapes.min.js:8871) at i.each (grapes.min.js:9131) at i.trigger (grapes.min.js:9228) at i.o.trigger (g...

artf

@krunal039 about what event are you talking about? Can you provide at least an example of how reproduce it

krunal039

@artf below is codepen link and i have added custom component named slider. here when you drop slider to editor and than click on it and it should open trait manager and if you change Link Title or Link to Open to blank value it throws abo...

artf

I can't reproduce any error, but what I see wrong at the first look is how you update models then you don't need $(this.el), you have already this.$el

#628December 11, 2017by AH1N13 answers
3 reactions

exclude components from final html

Is there any ready solution to exclude some components from final html? Or any other mechanism that makes component exist only in view?

ryandeba

Hi @AH1N1, By "final html", do you mean the value returned from editor.getHtml()? And are you referring to a custom component? If the answer to both of those questions is yes, then you should just be able to override the toHTML method of y...

ryandeba

@AH1N1 Here's a working code example: https://jsfiddle.net/tt32z2uz/2/. Open up you browser console and you should see this logged out: <div>here's some normal content</div><div>...more normal content</div>. Does that give you what you nee...

artf

Hi @afotey What about if I wanted to return just the ID of a div as entered using the Component Settings panel? Id assigned from component settings goes directly inside attributes therefore you can use this Is there a way to have the expor...

#627December 11, 2017by hatchwald3 answers
1 reactions

default feature just 1 ?

i am sorry , maybe i am forget to read detail , but default feature just 1 (just block) ?

hoainam12k

You can use basic blocks here: https://github.com/artf/grapesjs-blocks-basic (and other from README file)

hatchwald

I was try to find code that feature but , i am still haven't find it yet

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#626December 10, 2017by z1lk3 answers
0 reactions

Placing non-editable HTML around wrapper

My CMS works like this: sites can have one theme and many templates under that theme. Themes are rendered on every page, and templates are rendered only on specific pages. I have successfully integrated GrapesJS with my existing template editor, but I have a question: is there any way to render a theme around a templa...

z1lk

I've fiddled with the code and made a small patch that fits my needs. A config option surround lets you specify an ID, which represents an element in the container. This DOM subtree is plucked out during the main initialization, stored in...

artf

Greate @z1lk I think even something like this will work I close this as you've solved your case

z1lk

I used a solution similar to yours so I don't have to maintain changes to the Grapes source. Sometimes the position of the component "tools" are out of place, as if their vertical offset is computed relative to the body and not the wrapper...

#625December 10, 2017by Caimilan3 answers
2 reactions

editor.store(); fires multiple times

Hi @all, I use my custom code to stop data to server. All works fine, but editor.store(); fires once on first click, twice on second click, three times on third click ... and so on. In storageManager -> type I use 'remote' - if use 'local' , fist click takes no effect. Can anyone help?

artf

Every time you call save-db you attach a new listener pull it out from your command

shareefhiasat

do it like this so we dont attach listeners every time

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#624December 8, 2017by MuTaToR082 answers
0 reactions

not selected element

What should the isComponent function return so that this element can not be selected in the editor?

artf

You can make use of selectable property, so you should return return { type: 'your-type', selectable: false }

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.