HTML: Javascript : So I get in the blocks panel a b...","answerCount":3,"author":{"@type":"Person","name":"ghuser123","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2Fghuser123"},"dateCreated":"2020-05-10T14:19:36Z","dateModified":"2025-02-03T21:57:32Z","acceptedAnswer":{"@type":"Answer","text":"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 given id http://localhost/api/store create a project","dateCreated":"2020-05-10T20:30:18Z","upvoteCount":3,"author":{"@type":"Person","name":"Ju99ernaut","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2FJu99ernaut"},"url":"https://gjs.market/issues/2763-grapesjs-and-php-store-and-load-data-to-show-in#answer-626385155","sameAs":"https://github.com/GrapesJS/grapesjs/issues/2763#issuecomment-626385155"},"suggestedAnswer":[{"@type":"Answer","text":"@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 ?","dateCreated":"2020-05-10T20:55:36Z","upvoteCount":0,"author":{"@type":"Person","name":"ghuser123","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2Fghuser123"},"url":"https://gjs.market/issues/2763-grapesjs-and-php-store-and-load-data-to-show-in#answer-626388366","sameAs":"https://github.com/GrapesJS/grapesjs/issues/2763#issuecomment-626388366"},{"@type":"Answer","text":"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 what to do once the data is loaded. For example: Also update these in storage manager You may also have to setup a way to keep track of which page you are editing You can also check out this tutorial on...","dateCreated":"2020-05-10T22:02:45Z","upvoteCount":0,"author":{"@type":"Person","name":"Ju99ernaut","url":"https://gjs.market/go?url=https%3A%2F%2Fgithub.com%2FJu99ernaut"},"url":"https://gjs.market/issues/2763-grapesjs-and-php-store-and-load-data-to-show-in#answer-626396507","sameAs":"https://github.com/GrapesJS/grapesjs/issues/2763#issuecomment-626396507"}]}}
Issue #2763✓ SolvedOpened May 10, 2020by ghuser1233 reactions

GrapesJs and PHP - store and load data to show in editor and as HTML page as well

Quick answerby Ju99ernaut3

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)

👍 Most helpfulJu99ernautMay 10, 2020

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}...

ghuser123May 10, 2020

@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 ?

Ju99ernautMay 11, 2020

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.