I/O operations with PHP/MySQL - I'm stuck
Is there any reason why you can't use PHP to save it directly as a JSON file rather than on the database?
Read full answer below βQuestion
Hello and thank you for GrapesJS. It's awesome. I do have a question that I haven't been able to find an answer to. I'm using PHP/Yii and MySQL db. Your example for external storage config:storageManager: { type: 'remote', urlStore: 'http://endpoint/store-template/some-id-123', urlLoad: 'http://endpoint/load-template/some-id-123', }{ // gjs- is the id prefix 'gjs-components': [{ tagName: 'div', ... }, {...}, ...], 'gjs-style': [{...}, {...}, ...], } My problem is that I'm trying to get the HTML to JSON conversion formatted properly before saving to the db record so we can pull it up again fro...
Answers (3)
Is there any reason why you can't use PHP to save it directly as a JSON file rather than on the database?
I probably could, but we need to saved to DB. I'm OK, a developer figured it out for me, but it would be great to have some more detailed code examples for use with php/mySQL. Your docs are great, but this would be a nice addition to your docs section.
My problem is that I'm trying to get the HTML to JSON conversion formatted properly GrapesJS, by default, generates 4 types of data: HTML, CSS, Components (JSON from HTML), Styles (JSON from CSS) So you shouldn't do any kind of conversion... it's explained here https://grapesjs.com/docs/modules/Sto...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3589
Autoload storage is not working on page refresh
Hi, firstly I want to say that this project is awesome, thank you! I used code from GrapeJS Demo example, and added there save and load dat...
Issue #2929
Keep getting CORS when using fake endpoint for remote storage
Hi everyone! I'm using grapesjs with vuejs and I'm struggling with CORS. I created my fake endpoint with beeceptor and I have the code belo...
Issue #2894
How Do I Hide / Disable Dropzone in AM Modal
Hello, I've been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the A...
Issue #1985
Autosave with remote storage doesn't send network requests
OS: Windows 10 Browser: Chrome 73 GrapesJS version: 0.14.57 I have remote storage configured using this call to grapesjs.init(): While I se...
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.