Why does the editor itself not using `gjs-html``for canvas representation?
Well, if you load back the HTML you'll lose all the component information (kind of explained here). As an analogy, try to think about Photoshop files and JPG as an output. If you load back the JPG you won't see the layers used in your Photoshop project. It's up to you find the way to make the interpolation work with y...
Read full answer below ↓Question
Hey,
we are currently using grapejs to create liquid templates (shopify syntax). The way its currently implemented will leave the template, for example ``{{ name }}`, unrendered within the editor.
This is due to the fact, that even if the gjs-html gets interpolated by the server after a store/load cycle, the editor still uses not-interpolated gjs-components to represent the editors content.
Why does the editor not use the rendered html to display? As i understand the component structure is only used internally for component assignment.
Is there a way to work around this behavior? (I dont really want to run my interpolation on the components json)
Answers (1)
Well, if you load back the HTML you'll lose all the component information (kind of explained here). As an analogy, try to think about Photoshop files and JPG as an output. If you load back the JPG you won't see the layers used in your Photoshop project.
It's up to you find the way to make the interpolation work with your components (eg. making an async call to some endpoint and update the content of the component)
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2144
[QUESTION] how to create custom element
Hi guys, I'm new in this so I'm sorry for my question. I'm trying to use grapesjs to edit email templates. Is it possible to have dynamic f...
Issue #3268
How to add javascript in the html without sanitization?
Hey @artf, I am taking javascript input from the user. I need to add this javascript inside the template HTML but it gets sanitized. Is the...
Issue #3541
[QUESTION] What is the idiomatic way to append and remove classes from components?
Hey there 👋 Love the editor! We're using traits to modify what classes a component has, but that feels a bit hacky as you have to redeclar...
Issue #2776
[QUESTION] Is it possible to use grapejs for printable documents?
Hello, I have a requirement to create a drag and drop template editor for a desktop application, to generate beautiful reports, and found a...
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.