Issue #2365✓ SolvedOpened Nov 1, 2019by dukie662 reactions

Unable load predefined template.

Quick answerby pouyamiralayi2

template

Read full answer below ↓

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)

👍 Most helpfulpouyamiralayiNov 1, 2019
artfNov 2, 2019

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

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.