Issue #2941💬 AnsweredOpened August 6, 2020by nhh0 reactions

Why does the editor itself not using `gjs-html``for canvas representation?

快速解答by artf

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)

artfAugust 26, 2020

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

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.