Issue #2941Opened August 6, 2020by nhh0 reactions

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)

artfAugust 26, 20200 reactions

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.

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.