Template does not load using just components
Question
I am trying to load an existing template. I believe that it should work with either components or HTML but it seems to work only through HTML. The following code does not work but code with the corresponding HTML does.
The LandingPage Json was taken from the dev toolbar panel
const LandingPage = {
"html": null,
"components": "[{'type':'text','attributes':{'id':'i0fq'},'components':[{'type':'textnode','removable':false,'draggable':false,'highlightable':0,'copyable':false,'selectable':true,'content':'Insert your text here','_innertext':false}]}]",
"assets": "[]",
"css": "* { box-sizing: border-box; } body {margin: 0;}#i0fq{padding:10px;}",
"styles": "[{'selectors':['#i0fq'],'style':{'padding':'10px'}}]"
}
var editor = grapesjs.init({
height: '100%',
showOffsets: 1,
noticeOnUnload: 0,
container: '#gjs',
fromElement: false,
components: LandingPage.components ,
// We might want to make the same check for styles
style: LandingPage.style || LandingPage.css,
storageManager: {
autoload:true
}
});
Answers (1)
@Vikash-ra please follow the issue template when you create one.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1234
Template Problems with GrapesJS
Some templates just don't load well. Very simple templates do load properly, but there seems to be a problem with templates with more funct...
Issue #3097
BUG: Custom traits not showing up
I am trying to make custom traits following the guidelines from Grapesjs Trait manager, and I have been through previous issues but the tra...
Issue #1911
[Question] Is Knockout.js compatible with Grapesjs?
I'm trying to implement an attr binding on one of my components using Knockout.js. It works perfectly fine otherwise but the same implement...
Issue #1365
[QUESTION] Vertical panel buttons
Hi, I am trying to add vertical buttons in a panel. I have added a flexbox with a vertical direction, but since an additional div is added...
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.