QUESTION: Why does the editor itself not using `gjs-html``for canvas representation?
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 #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...
Issue #2596
[QUESTION] Add html, css and js to Block Manager
[QUESTION] Hi! I'm retrieving dynamic html,css and js codes from the database. How can I create Blocks with this? Currently, this is my cod...
Issue #1707
Find images links in the editor
I am trying to integrate GrapesJs in reactJs. Can you please help me out with the below question w.r.t GrapesJs-React, • Is there a way to...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.