Issue #3399Opened April 9, 2021by AdamTorma2 reactions

Convert JSON to HTML server-side

Question

So first of all, thank you @artf for this amazing project.

I have a question: Is it possible to easily convert the components-JSON to HTML on the server-side (in a Node.js environment)? If it is possible, can you give me a hint how to achieve this?

On the client-side it's quite straightforward: I can get the components-JSON (JSON.stringify(editor.getComponents());) and save it to my database. Then I can reuse my components later (editor.setComponents();) and get the HTML (editor.getHtml();) to show it in the browser. In my case though, I have to do it on the server-side.

Any help would be greatly appreciated!

Answers (3)

bgrand-chMay 11, 20211 reactions

Hello,

For future questions or technical issues, which aren't bugs, GitHub's Discussions tab is the place to be.

Don't forget to close this issue if it is resolved or write a new detailed message in Discussions -> Q&A category (and close this issue).

Thank you for your understanding.

anlumoJuly 29, 20211 reactions

Yes, if you have any kind of interactive content, that probably wouldn't work. Fortunately that's not the case for my application.

Ju99ernautApril 14, 20210 reactions

Maybe you could install grapesjs server-side(similar to client-side) and use it for rendering, otherwise you'll have to reverse engineer the renderer. Another alternative would be to store the generated HTML in the database as well.

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.