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?
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"
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
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.
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.
Hi again! As I comment in a previous question, We're working with several editors in the same window. The issue we're facing now is that layer manager doesn't work fine when I go from one editor to another. These are the steps that make this problem happens:Editors initiatedGo to Layer Manager inside editor 1 (click o...
artf
Thanks Kevin, I've found the issue and the fix will be available in the next release
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.
I have a website with multiple web pages (results-page, category page, home page) and a common css file for all pages (all.css).Within this css file : webpage (classes used) Home page ( class A, class B , class C) Results Page ( class B, class X, class Y ) Category page ( class R, class S , class X) When I load result...
JulyanoF
@RiyaThete to load css into editor, you need to insert it on grapesjs init, something like that: Or if you want to include css inline:
RiyaThete
@JulyanoF I tried this solution but this does not load all the classes of all my web pages.. it just loads all of the results page and few classes from other pages
artf
deleted few classes[ unable to understand why so ] Not used classes are not rendered The suggestion proposed by @JulyanoF is the valid oneit just loads all of the results page and few classes from other pages You can use as many styles you...
Hi! When the window is resized horizontally the toolbar stays in the same place. Here is a pic from the demo version: I noticed if I add methodsmethod; to the toggleSelectComponent method in commands/view/SelectComponent.js file, the issue seems to be solved. I don't know if it's the correct approach. Thank you!
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.
I'm using grapesjs-blocks-basic plugin that has a number of column blocks. When I drag and drop these blocs onto the canvas they are displayed correctly for the first time and I can see the associated CSS added in the code viewer. But, once I invoke 'core:canvas-clear' command and drag-and drop the same blocks they ar...
artf
I just merged https://github.com/artf/grapesjs-blocks-basic/pull/4 which solves the issue. I'll publish soon a new release of the plugin