Change the background of the body
Question
Hello,
First of all, I want to thank you for this amazing project! I have few a questions regarding the editor, and more precisely the newsletter preset:
-
I want to add a button in the block manager which can give a quick access to change the background of the body (without going to the component tree).
-
Furthermore, how can I reorganize the commands buttons in the panel manager? (I want to change positons and delete some) -> I'm using the newsletter preset
-
I don't know if there is a way to resize the preset "button" block after changing its style. Or if I add a custom block "button", how can I make it resizable and add the href property to it?
Thanks for your support!
Answers (3)
Here's how I remove buttons
editor.Panels.getButton('views', 'open-sm').set('active', false)
@Geczy, thanks but the set("active", boolean) method only switches the highlight mode of the button. Actually It doesn't remove it.
Hi @asvine-p
I want to add a button in the block manager which can give a quick access to change the background of the body (without going to the component tree).
Once the editor is loaded you can add/remove stuff with JS (your button will be binded with some handler)
Furthermore, how can I reorganize the commands buttons in the panel manager? (I want to change positons and delete some) -> I'm using the newsletter preset
Here is an example from the newsletter preset how I change/remove buttons https://github.com/artf/grapesjs-preset-newsletter/blob/master/src/buttons.js#L36-L37
I don't know if there is a way to resize the preset "button" block after changing its style. Or if I add a custom block "button", how can I make it resizable and add the href property to it?
You can't "change" (besides playing with paddings) its size because the built-in "Button" block is a link (inline element), but you can add your custom block and set, for example, in style "display: block" (or inline-block) this will allow editing it size
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1639
[Question]: Would it be possible to have change settings under style manager in a way that it has href when a link is created?
I'm using preset newsletter with built-in RTE (do not want to use ck editor like the demo) In order to make any text to link, i need to cli...
Issue #1989
[QUESTIONS] Canvas in Modal
is it possible to make modal that can be a canvas? I want to make a button that displays modal, then I can add the modal component from the...
Issue #457
Two Quick Questions
Hi @artf 1) I have my editor templates like this : I want to change the alignment and also add a back button to the corner left like this o...
Issue #1951
[QUESTIONS] change or add event on add component from block
is it possible ?, change the drag and drop event to on click when adding a new component, I want to add components by clicking the block th...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.