GrapesJS Issues

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

3464 issues found

#1969April 20, 2019by minuwan2 answers
0 reactions

Rename attributes (Editor)

Is there any way to rename "data-gjs-" attributes to "data-myOwnProjectName-"? For example:"data-gjs-type" => "data-myOwnProjectName-type""data-gjs-droppable" => "data-myOwnProjectName-droppable" etc...

artf

No, currently it's hardcoded https://github.com/artf/grapesjs/blob/5fe64423b2a4c94f5b3cd9b7b8e1d887a8896ab0/src/parser/model/ParserHtml.js#L4

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.

#1968April 19, 2019by sakshigarg92 answers
0 reactions

Get information on action that was undone

Is it possible to extract information on what was undone. I tried but I'm unable to fetch information on exactly what was undone, the value of after property under model.attributes is null. I wish to extract the id of the element that action was performed on and what update in style/removal/property/edit was made.

artf

Check model.attributes.type to understand the action executed, probably the after is null because the action was remove

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.

#1967April 19, 2019by iainheng1 answer
0 reactions

Wrap built-in component with div html

I am trying to wrap the video component specifically for Youtube's <iframe> with a parent <div class="embed-responsive embed-responsive-16by9"/> container. This is the example of the end result I wanted to achieve:

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.

#1966April 19, 2019by trafalmejo3 answers
0 reactions

[QUESTION] Loop over all components

Hi all, I want to create a socket for every button that I add to the canvas. This is working just fine. However, when I reload (using storage), I have to look for my components of type "Button" and reopen the sockets. Is it a way to loop over the components? Best,

artf

Hi @trafalmejo in case you need to iterate component's first level children you can do this: If you need to lookup ALL inner children, use onAll Once the component is rendered you can also make use of find method and pass any query selecto...

trafalmejo

Perfect! Highly appreciated.

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.

#1965April 13, 2019by vinayakprabhu3 answers
0 reactions

Custom content type

@artf Instead of using plugins js files, can we create our own content using html as I have done below. Is it a correct way to do it? Sorry for the formatting unable to format.. Thanks in advance.

artf

Is it a correct way to do it? yes...

vinayak99999

Thank you for your reply @artf . I just have one more query I want to have an vertical carousel. So from the above code snippet where do I add say Jquery or script for delay or scroll effect

artf

Create a new component type and follow this guide: https://grapesjs.com/docs/modules/Components-js.html

#1964April 13, 2019by richbai902 answers
0 reactions

[QUESTION] Minimal requirements to create a custom component

I've been reading the docs all day on creating a custom component. I've also looked at grapesjs-mjml for an example. I'm trying to create a base type for react components that can be extended as needed, but at the moment all I want to see is which lifecycle methods are called and when. I'm trying to work out the diffe...

artf

First of all, start using the improved definition of components. In your example, the content: (<div>Foo</div>), will be compiled to an object, and when you add an object/array of objects to the editor, it means you don't need the parsing...

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.

#1963April 13, 2019by benvmatheson2 answers
0 reactions

Component has a dash in API docs

In API docs, the component header is prepended by a dash. Not sure if that's on purpose.

artf

Yeah, the intention was to emphasize it being under the DOM Components module but seems like I failed 😬

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.

#1962April 12, 2019by Ramkumar-Murugesan2 answers
0 reactions

[QUESTION] any other way to listen the traits option changes

HI, I added the code of listening to the changes made when the user selects the values in the dropdown. but I need to listen to the changes in some other places in the code. In the above change working fine. but I need to listen to the changes in another place. can anyone please help me

artf

You can make use of a global listener editor.on('component:update:mytype', ...) or trigger some custom event inside the local method

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.

#1961April 11, 2019by micker3 answers
0 reactions

Some user return

Hello i try to use grapesjs like an enduser to builde a page some returns : how to select row to change width when we use column blocks ? its realy difficult to use ....i create a box + text it realy strange impossible to change height of box it always 75px ... realy strangehow to create a 4 columns elements ? thanks...

artf

how to select row to change width when we use column blocks ? its realy difficult to use .... You can change the row width in Style Manager (Dimension sector)i create a box + text it realy strange impossible to change height of box it alwa...

micker

ok thanks i will try !

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.

#1960April 10, 2019by davydav3 answers
0 reactions

[QUESTION] Dynamic class generation with a template

Hi there ! I am wondering if there is a way to force the dynamic class generation (of the form cXXXXX which happens when I drag'n'drop a component) at template import ? The problem is, when I use a template, the generated components in the editor don't have that dynamic class, which I need to be able to generate media...

artf

Hi Davy, if you need a class you can set it already in your template, if you need a dynamic one, probably you would make use of events like component:add or block:drag:stop

davydav

Thank you for your answer ! Is there anyway to access your method of class generation, or could you point me to where it is in your code ? I've been trying to find it but no luck ! Thanks again

artf

https://github.com/artf/grapesjs/blob/5fe64423b2a4c94f5b3cd9b7b8e1d887a8896ab0/src/dom_components/model/Components.js#L70-L87 As you see it's called on add, so you can actually disable it (forceClass option) and implement your own logic