GrapesJS Issues

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

1,399 issues found

πŸ” outdated
#827Feb 1, 2018by hillelcoren3 answers
0 reactions

Change location of command panel

Amazing library, thank you!! I have two questions I'm hoping you can help with.How can I move the command panel from the top to the left as is shown here: https://github.com/artf/grapesjs/wikiI was having trouble getting the block icons to show, I saw individual letters instead. I was able to fix it by copying the mai...

artf

Hi @hillelcoren How can I move the command panel from the top to the left as is shown here Panels are all arranged freely by CSS so you can move them as you wantI was having trouble getting the block icons to show, I saw individual letters...

hillelcoren

Thanks for your help!

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.

#824Jan 31, 2018by anand-gopinath3 answers
5 reactions

Is it possible to remove "views" of editor Panel

I wish to remove/hide the below mentioned "view" from the Panel. Is it possible via API or I need to externally hide using css ? editor.Panels.getPanel("views").attributes.buttons.models[2].attributes.visible = false;

ryandeba

@anand-gopinath - this code works for me in a plugin: editor.Panels.removeButton("views", "open-layers"); It doesn't seem to work for me after the editor has fully loaded...I suspect that it needs to get removed before the view is rendered...

ryandeba

@anand-gopinath In case it's helpful, here's some code that I'm using to reorder those buttons (this also probably needs to run in a plugin):

artf

Thanks Ryan, I'll add a new listener, in the next release, which should fix the issue

#823Jan 30, 2018by JulyanoF2 answers
0 reactions

Set selected content is not affecting editor.getHtml() completly

When I use editor.getSelected().set('content', 'somethig'), theoretically it changes value correctly as I see in editor, but when I call editor.getHtml() or I enable autosave (that probably call getHtml()), it is showing "<div class="c891">somethingInsert your text here</div>". It is always incrementing the text. Edit...

artf

https://github.com/artf/grapesjs/issues/820#issuecomment-361732512

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.

#822Jan 30, 2018by josefph3 answers
0 reactions

How to get the html and css code in view code tool?

or how to get all the html code and css so that I could save it in my database. Or there is already a functionality in the documentation? your help will be much appreciated :)

josefph

Sorry for this post. I was only able to look at the Open Issues not knowing that there are closed issues. I was able to know that I could use editor.getHtml() and editor.getCss() which I could just save right away in my database to save my...

artf

@pranzikkin you can set up a remote storage #778 which will store your data automatically

josefph

what do i put in UrlStore?

#821Jan 30, 2018by Deepak8133 answers
0 reactions

How to set the href attribute

Hi @artf, Please let us know how we can set the href attribute of anchor inside div when element is dragged i.e <div class="social_icons rrssb-buttons c3250"> <a href="https://www.facebook.com/sharer/sharer.php?u=http://starteo.softobiz.com" class="popup rrssb-facebook" id="ibvm"><i aria-hidden="true" class="facebookS...

JulyanoF

@Deepak813 I guess that it isn't in model, it should be something like: editor.getSelected().set('href', 'https://www.facebook.com/sharer/sharer.php?u=') You don't need to access model

Deepak813

Hi @JulyanoF, Thanks for the message, I have used this code when element is dragged but display following error: Uncaught TypeError: Cannot read property 'set' of null. As i want to update the href of anchor tag inside the div when element...

JulyanoF

@Deepak813 Oh, you want to change anchor when is draggin/dropping?

#820Jan 29, 2018by JulyanoF3 answers
0 reactions

Change and get value of editor.getSelected() block

How can I change and get the content of current selected block?

JulyanoF

To get content: editor.getSelected().get('content') To set content: editor.getSelected().set('content', 'myhtml')

artf

@JulyanoF be aware that content is for static strings (used mainly for custom RTEs) therefore by doing this editor.getSelected().set('content', '<div>TEXT1</div>...') you wouldn't be able to edit inner elements.

JulyanoF

selected.components() @artf I don't want to create a new component into the selected block,. I need only edit the content. When I use this method, it is creating a new div into the previous block. How can I avoid it?

#818Jan 29, 2018by JulyanoF3 answers
0 reactions

Open different Panel's view on click text element

How can I make "click" event on texts open different panel's view than StyleManager? I'm trying this:

artf

different panel's view than StyleManager Probably you're talking about the behavior in the demo, implemented by the webpage preset here https://github.com/artf/grapesjs-preset-webpage/blob/master/src/panels/index.js#L106 So in your case, i...

JulyanoF

@artf so, I tried it and didn't work, it isn't setting active my panel button with id "editorCK"

artf

Did you create the abrirEditor command?

#816Jan 29, 2018by arthuralmeidap3 answers
3 reactions

Adds image block trough Editor API

Hi @artf , When I drag and drop a Image block within the canvas it triggers the active event for the image block thats runs the openModal method. Shows a modal to upload the image. I'm trying to run editor.addComponents({ type: 'image' }); and shows the modal to upload the image. I didn't find any API methods that pro...

arthuralmeidap

yes, you are right @artf . I didn't think about dumb cases like that you mentioned. It worked very fine to me. I just thought if was not the case to embedded such behaviour within the addComponents or somewhere else. Thanks for all the hel...

arthuralmeidap

@chiqui3d, thanks for the feedback but the image block was just an example. In my case I have created a new Type and I was trying to trigger the active event for my component. It works exactly like the image block that's why I used the ima...

chiqui3d

I think this will help you. editor.runCommand('open-assets'); https://github.com/artf/grapesjs/wiki/Assets

#815Jan 29, 2018by chiqui3d2 answers
0 reactions

Show text trait for links if the link has no children

I hope to explain well, when I edit a link I don't see the possibility of editing the text of that link. I think it would be a good idea if that link doesn't have children, such as an image, it should display the text field in the style manager settings. Thanks

artf

The Link extends Text Component so you just have to double-click on it to start editing

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.

#814Jan 29, 2018by vishal50332 answers
0 reactions

Disable selectable, hoverable and editable options when Mobile view is on.

Hi, I want to disable to select, hover or edit the components of the editor when the Mobile view is on. I have tried using below code. But it removes all the components from the editor. Can you please help me out? Thanks,

artf

Probably because you're passing a collection (wrapperChildren) to updateAll which expects a model

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.

Browse all topics