GrapesJS Issues

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

3464 issues found

#3373March 31, 2021by ikenderham1 answer
0 reactions

Question: 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

#3371March 29, 2021by devtechk1 answer
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

#3370March 29, 2021by xinnaiNo answers
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...

#3369March 28, 2021by jcsofts2 answers
0 reactions

FEAT: 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

#3367March 26, 2021by kerryj893 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.

#3366March 26, 2021by kerryj893 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.:

#3365March 26, 2021by Franci5co5aoco3 answers
0 reactions

QUESTION: 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...

#3364March 25, 2021by NagarRahul2 answers
0 reactions

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 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)

#3363March 24, 2021by nairdapuiu1 answer
1 reactions

BUG: 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)