Issue #1912💬 AnsweredOpened March 21, 2019by simplecommerce0 reactions

Custom component default children

Quick answerby artf

@simplecommerce a working example of a custom component with default children (it uses local storage) https://jsfiddle.net/t5yw48cs/ Try to review the way you store/load templates, maybe the issue is there https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates

Read full answer below ↓

Question

Hi, I am trying to understand how I can achieve the following.Create a component with a default content as children.Create a block to add that component to the canvas.Edit the component children to anything else and save the HTML result.Reload the component in the editor later on and continue editing. My issue is the following:I have tried using components and content in defaults.I have tried defining some custom logic in init function of the view of my component, to only append the default value is no components exists. Both these methods, do not work, they work at first, but if I edit the t...

Answers (2)

lock[bot]March 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.