Issue #2234πŸ’¬ AnsweredOpened Aug 30, 2019by arievanden0 reactions

I/O operations with PHP/MySQL - I'm stuck

Quick answerby smik3

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)

smik3β€’ Sep 3, 2019

Is there any reason why you can't use PHP to save it directly as a JSON file rather than on the database?

arievandenβ€’ Sep 4, 2019

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.

artfβ€’ Sep 6, 2019

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.

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.