Body -> Decorations -> Background-image
As a workaround for body background I use the following actions:save body background to DB separately from components and styles, via editor.DomComponents.getWrapper().attributes.stylewhen template is loaded set the style via editor.DomComponents.getWrapper().setStyle(/set proper styles/)clear canvas with editor.DomCo...
Read full answer below βQuestion
Version 0.14.25 | Local copy GrapesJS Tested in: Chrome 68, Firefox 61 Add a background image in "Body (Selected #wrapper) -> Decorations -> Background -> Layer # -> Image", save to db, refresh page, load from db, blank background. Same with image or color. Adding background After refresh page and, how can add a background image gif or video? need to pull a request? Thanks.
Answers (3)
As a workaround for body background I use the following actions:save body background to DB separately from components and styles, via editor.DomComponents.getWrapper().attributes.stylewhen template is loaded set the style via editor.DomComponents.getWrapper().setStyle(/set proper styles/)clear canv...
I need to know what do you store in DB and how do you load it.
Hi, this is the code. This is the php code: store for load Thanks.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4174
Refresh page we will lost body/wrapper background color
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 98.0.4758.109 Reproducible demo lin...
Issue #2044
Npm start to develop on local server didn't work
Did the procedure to start the local server using dev branch as described on README, it worked on the console, but fails on chrome and the...
Issue #373
Color input does not update the element on page
when using the color picker everything works fine. however if you add a hex value to the input and press enter the color preview updates bu...
Issue #1812
[Bug]: 404 when trying to add background image (reproducible in demo)
Visit https://grapesjs.com/demo.html in Chrome IncognitoClick the "Header" elementClick Decorations > BackgroundDelete Layer 2Click Layer 1...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline β both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.