Unable load predefined template.
Question
I want to show a predefined template when users open grapesJs something like this: Storage manager.
HTML:
<div id="gjs" style="height:0px; overflow:hidden"></div> <script src="app.js"></script>
javascript in app.js:
// Set up GrapesJS editor with the Newsletter plugin
const LandingPage = {
html: '<div> style="background-color="red"; height="100px"; width="100px"</div>',
css: null,
components: null,
style: null,
};
components: LandingPage.components || LandingPage.html,
style: LandingPage.style || LandingPage.css,
clearOnRender: true,
storageManager: {
id: 'gjs-',
type: 'local',
autoload: true,
autosave: true,
storeComponents: true,
storeStyles: true,
stepsBeforeSave: 1,
// contentTypeJson: true,
},
Result: Blank editor

Answers (2)
@dukie66 <div> style="background-color="red"; height="100px"; width="100px"</div> this is not how you supposed to write HTML
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1433
Toolbar on hover
@artf how can we show toolbar on hover. Currently toolbar is open when we select any element but I want to show it on hover. Any help would...
Issue #2710
[QUESTION] Unsplash images in asset manager modal
Hello, I want to add a support for unsplash API when user opens AsssetManager modal with search input (similar to Grapedrop) Is there an ea...
Issue #2893
[Question] Can I set for loop value in components render?
Hi,I'm beginner in grapesjs. I want to make a question number by for loop when I dropped components, ↓I want final like this image. the div...
Issue #2757
[HELP] Hide style manager if no component selected
Hi, i want to reproduce default gjs behavior, when style-manager is hidden if no component selected. like this: But it seems like this does...
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.