Not editable block after import template
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)
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));
@artf if I use <strong>text </strong> importer template will fail and convert text element into box sample template to reproduce the issue. #1906
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.
Issue #3119
[QUESTION] How to create custom block made of grapesjs components?
Hi, i want to have custom blocks made of grapesjs components. I found solution how to add components: https://github.com/artf/grapesjs/issu...
Issue #4732
Tabs behaviour after HTML import
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 107 (MacOS) Reproducible demo link...
Issue #3245
grapesjs-custom-code doesn't execute <script> from GrapesJS 0.16.30 and up
grapesjs-custom-code work fine with script tag until GrapesJS 0.16.27, after this version, no script content is executed. ✔️ Editor init()...
Issue #3058
How to modify existing block properties in style manager
Version: 0.15.9 How to modify/remove few CSS properties for existing blocks like(text, image) in style manager I have checked the following...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.