GrapesJs and PHP - store and load data to show in editor and as HTML page as well
You're supposed to setup a RESTful API, for example: sql db.php store.php load.php .htaccessAdd this to your .htaccess file Given you add the files to a folder called api you'll have the following endpoints: http://localhost/api/load/{id} load a project with given id http://localhost/api/store/{id} update project with...
Read full answer below ↓Question
I am using GrapesJS to build a simple webpage. I included the script in the following way inside head part : I am using GrapesJS to build a simple webpage. I included the script in the following way inside head part : <script type="text/javascript" src="js/jquery-1.10.2.js"></script> <link rel="stylesheet" type="text/css" href="grapesjs-dev/dist/css/grapes.min.css"> <script type="text/javascript" src="grapesjs-dev/dist/grapes.min.js"></script> HTML: Javascript : So I get in the blocks panel a block namely Simple block which I can drag and drop on the editor. When ever any change is made then...
Answers (3)
You're supposed to setup a RESTful API, for example: sql db.php store.php load.php .htaccessAdd this to your .htaccess file Given you add the files to a folder called api you'll have the following endpoints: http://localhost/api/load/{id} load a project with given id http://localhost/api/store/{id}...
@Ju99ernaut , Q1) are all my frontend code snippets right ? Q2) How can I get the $_POST variable ? In the browser network inspection tab, I only see request payload. $_POST is empty there. Q3) For loading purpose, will the saved data be automatically attached to the editor ?
I guess the $_POST variable only works for url parameters, I've updated the code to use the $data variable, your front end snippets are fine however on load the data will not be automatically attached to the editor since the load method only sends a GET request, you will have to tell the editor wha...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #890
[Question]: I cannot get the simple example working
I am not new to Javascript but when I try the example: I get a blank page. That is with adding the CSS and Javascript library. Any suggesti...
Issue #1686
CMS: Grapesjs is not defined
I am trying to use basic Grapesjs editor to CMS. Here's my code: I have installed the grapesjs using NPM. Later I tried running this html f...
Issue #597
storageManager: Loading from remote storage
Hi, I'm trying to read the HTML and CSS from my database. When I try to load it into the editor, nothing displays. I can store the data jus...
Issue #2120
CSS properties of body (#wrapper) not editable after editor.setComponents(html);
When I save my page in a database refresh, the html and css are set like so $.ajax({ url: "../feeder.php", type: 'POST', processData: false...
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.