Issue #2365Opened November 1, 2019by dukie662 reactions

Unable load predefined template.

Question

I want to show a predefined template when users open grapesJs something like this: Storage manager. image 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 image

Answers (2)

pouyamiralayiNovember 1, 20192 reactions
artfNovember 2, 20190 reactions

@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.

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.