Save form, reuse it when required
Hi @absolution54321 it's something you should be able to implement by yourself, make use of Blocks API
Read full answer below ↓Question
#I don't know if this exists or not, is it possible to to create a form, save it and reuse it without pasting it into import screen. Currently an import screen is present where one can paste a HTML code, which is an unnecessary task we can provide user with the option to drag n drop previous saved forms and play with it
Basically what I thought was
- User will create a form
- He will save it or export
- after export there should be a scenario where he can drag n drop that existing form, edit it maybe
Any leads?
Answers (2)
Hi @absolution54321 it's something you should be able to implement by yourself, make use of Blocks API
// Just an example, on selected component you click, somewhere... 'Save element', and
const selected = editor.getSelected();
editor.BlockManager.add('new-block-uuid...', {
label: `Saved ${selected.getName()}`,
content: selected.toHTML(),
});
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.
Issue #2009
'Select' trait no updated in edit mode
Hi there, There is a problem with me, I don't know if it from my code or from grapejs itself, For LINK tool, it takes its links from my DB...
Issue #1960
[QUESTION] Dynamic class generation with a template
Hi there ! I am wondering if there is a way to force the dynamic class generation (of the form cXXXXX which happens when I drag'n'drop a co...
Issue #1485
How to prevent styling html components?
Im trying to create some templates, which should not be editable and styleable. So that when i drag in my blocks then should stay as define...
Issue #1079
Improper Bg Repeat CSS Being Set
When importing components and initializing grapesjs, the css background-repeat property is being changed to background-repeat-x and backgro...
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 →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.