GrapesJS Issues

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

3,464 issues found

#3373Mar 31, 2021by ikenderham2 answers
0 reactions

Predefined background colors when selecting a element with a certain class or div.

I have a question i hope sombody can help with. I want to make a trait where i can chose predefined colors, when selecting a div with a certain div. Can anyone help me, how to achive that in a simple way?

artf

Well, you can use a simple select trait type with the list of colors and update its style once is changed. Here you can find all the examples necessary for your case: https://grapesjs.com/docs/modules/Traits.html

GJSBlock

Thanks for reporting this, @ikenderham. Great question about Question: Predefined background colors when selecting a element with a certain class or div.. The recommended approach with GrapesJS is to use the event-driven API. Start here: C...

#3371Mar 29, 2021by devtechk2 answers
2 reactions

Generate pages numbers any idea?

Hi, guys I'm creating a doc generator through grapesjs, I'd like to insert page numbers like "Page 1 of 5" at the bottom of each page. My starting template have a wrapping class called .page actually I'm able to clone one page under one other to get more pages. Do you have any idea, how can i implement this feature ?...

devtechk

Hi Guys! I've found a way to achieve my goal! CSS property! here's my working code (you can call pagination tag as you want). Source: https://www.pagedmedia.org/paged-js/ HTML: <pagination class="text-right paginating">Pag </pagination> CSS

GJSBlock

Thanks for reporting this, @devtechk. Great suggestion about Generate pages numbers any idea?! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event system: Alternative a...

#3370Mar 29, 2021by xinnai1 answer
0 reactions

Compressed getJs issue

@artf Hi, I'm not sure if you understand my question. I want to edit the js code in my own js editor, first I set the js code from your editor using getJs(), but it looks like this in your demo.html: These code are all compressed. I want an uncompressed code like this in https://github.com/Ju99ernaut/grapesjs-script-e...

GJSBlock

Thanks for reporting this, @xinnai. Great question about Compressed getJs issue. 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()...

#3369Mar 28, 2021by jcsofts3 answers
0 reactions

Is it possible add a relative offset for the colorpicker

for example: I add a left bar and top bar outside the editor. I know the colorpicker's position is relative the body, so is it possible add a relateoffset to the config. so I can add a -40 to mek the colorpicker to right position?

artf

You should be able to define color picker options in this way here you can check all the available options

skru

Is it possible to access the colorPicker after .init()? I'd like to dynamically update the pallete

GJSBlock

Thanks for reporting this, @jcsofts. Great question about FEAT: is it possible add a relative offset for the colorpicker. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation f...

#3368Mar 27, 2021by sizhousama2 answers
0 reactions

I need to reload "https://.../main.js" every time I add a block,what should I do?

I need to reload "https://.../main.js" every time I add a block,what should I do?

artf

Subscribe to the event you think might be useful for you and then reload as you wish

GJSBlock

Thanks for reporting this, @sizhousama. Great question about [QUESTION] I need to reload "https://.../main.js" every time I add a block,what should I do?. The recommended approach with GrapesJS is to use the event-driven API. Start here: C...

#3367Mar 26, 2021by kerryj894 answers
1 reactions

Modal template

Is there a way for me to modify the template from a compiled state? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0bd070c0b/src/modal_dialog/view/ModalView.js#L1-L16 If not, what would be the cleanest way to insert title and content into a modal skeleton from our CMS for a tighter look and feel?...

artf

Now it's possible to replace the modal https://grapesjs.com/docs/modules/Modal.html#custom-modal

Ju99ernaut

Here's a list of plugins that use the built in modals, hopefully they're helpful: https://github.com/artf/grapesjs-tui-image-editor https://github.com/artf/grapesjs-custom-code https://github.com/Ju99ernaut/grapesjs-template-manager https:...

kerryj89

Thanks, but I was looking for a way to inject the content into my own modal. A lot of libraries have a modal template file or variable to do this.

#3366Mar 26, 2021by kerryj894 answers
0 reactions

Extending preview command

I am trying to extend the preview command. I expected the code below to run the normal preview command along with console output, but only console statement runs. How can I preserve the original preview code? The below works for me until someone can enlighten where my thought process went wrong.

artf

If you specify a new run() function the command will run only the new one, otherwise, it wouldn't be possible to fully change a command (here more about extending commands)

ronaldohoch

Hello Artf, oddly enough, i need the same thing he does. So, the best way to do is doing the same way he does? Running the original preview command inside the extended preview?

ronaldohoch

Well... Other thing i'm doing is extending the preview by running the command on event.:

#3365Mar 26, 2021by Franci5co5aoco4 answers
0 reactions

Contenteditable attribute on Layer's name span

Hi @artf I would like to know why layer's name span has a contenteditable attribute. There is no mechanism implemented on grapesJs to really change the layer name after refreshing the page if I'm not wrong. It can be a little bit confusing to the user. Thanks.

artf

If you double click on the layer name you can actually change its name :)

Franci5co5aoco

@artf , sorry I think I was misunderstood. I meant you can change the name but when you refresh the page the changes are not been saved... and I think that there isn't a mechanism implemented to achieve it. When the user modifies the layer...

artf

No, the mechanism to store/load custom layer names is there, the only issue is that the change is not triggering the store... indeed, if you try to move some component right after the change, you will see them after page refresh. Anyway, t...

#3364Mar 25, 2021by NagarRahul3 answers
0 reactions

@How to fix container size when we are drag element inside the container,Container will be expended according to the child dragged element. How we can auto size child element according to the parent container. Container should not be expend according to the child element. It's should be show scroll.

WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdDo a quick SEARCH first, to see if someone else didn't open the same issueAll relative statements/questions have to be filled/answered, otherwise, th...

NagarRahul

@artf when I drag button it is expend. I want to fix it. It's should not expend when drag new button. It will shoe scroll after overflow.

artf

it just depends on the styling of the component (eg. using display inline-block for that button might fix the that)

GJSBlock

Thanks for reporting this, @NagarRahul. Great suggestion about FEAT: @How to fix container size when we are drag element inside the container,Container will be expended according to the child dragged element. How we can auto size child ele...

#3363Mar 24, 2021by nairdapuiu2 answers
1 reactions

Set content function empties the component content

I am trying to use the set function to change the content of a component, but actually the result is an empty component with nothing inside. This is an example with the code summarized Version used: 0.16.44 What is the expected behavior? The code executed should result in a component with text "foo" inside. What is th...

artf

you shouldn't use the content property, use selectedComponent.components(str)

GJSBlock

Thanks for reporting this, @nairdapuiu. Great question about Set content function empties the component content. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

Browse all topics