How to import previous saved templates in new template.
Question
@artf I have saved some templates created by grapejs and want to use/import it in new template as a section / block. I do not want import as html and css, I want to import as Component and Style saved as JSON format so that component like countdown and other do not change to div or box and also updated style include the current template style and previous template syle and same for the model also, Any help would be appreciated.
Answers (3)
Think you're missing the point of grapes. It let's you edit HTML. There's no underlying JSON format.
@nojacko I have a template which contain countdown, If I direct import as html then it changed to div so I want to import that as json and css so that component do not change to other type and also there style value preserve for clone or copy.
@YashPrince take a look at your browser local storage values, you will see what/how is stored.
Anyway, if you make a custom component and load the normal html/css, grapesjs will recognize it as the right type when you import it. The custom component type in grapesjs is usually linked to the main container id, so you do not really need a json to accomplish that.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1662
How we can reinitialise editor
Hi @artf, Hope you are doing good. How we can reinitialise the editor with json data. We want to reinitialise editor with some of the previ...
Issue #535
New section in View Container
Hello, I want to add a new section in view container. Lets say, when we click Style manager it opens style manager. I want to create simila...
Issue #843
[QUESTION] - CssComposer - removes unused classes
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import,...
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.