Issue #1905✓ SolvedOpened March 19, 2019by yrbn2 reactions

Not editable block after import template

Quick answerby yrbn2

Sorry, I found the solution when was reading my own question))) components and styles are strings. For those, who is searching for solution: editor.setComponents(JSON.parse(value.components)); editor.setStyle(JSON.parse(value.styles));

Read full answer below ↓

Question

Have the same issue like in 1408. You said that JSON should be imported instead of the HTML. Can you tell me please how to import JSON template? I can't find the solution. On 'storage:store' I fetch an object: { assets: "", components: "", css: "", html: "", styles: "" } Then I run command: let emailTemplateStr = editor.runCommand('gjs-get-inlined-html') and save it. But after import this template(this.editor.setComponents(template)) some blocks have changed from "text" to "box" and are not editable by CKEditor. So, how the object should look to import it properly? As I guess I should put com...

Answers (3)

👍 Most helpfulyrbnMarch 20, 2019

Sorry, I found the solution when was reading my own question))) components and styles are strings. For those, who is searching for solution: editor.setComponents(JSON.parse(value.components)); editor.setStyle(JSON.parse(value.styles));

anish2690November 1, 2019

@artf if I use <strong>text </strong> importer template will fail and convert text element into box sample template to reproduce the issue. #1906

svalenciano81June 12, 2020

Sorry, I found the solution when was reading my own question))) components and styles are strings. For those, who is searching for solution: editor.setComponents(JSON.parse(value.components)); editor.setStyle(JSON.parse(value.styles));

what is "value" ?

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.