Issue #1331✓ SolvedOpened August 1, 2018by ionic6663 reactions

Can i create multiple pages?

快速解答by inventorbit3

You can make use of the following When you change the page, at first you store the current template: and then you change the editor with the next one Reference Link: https://github.com/ronaldaug/gramateria/issues/2

Read full answer below ↓

Question

This framework is great。It helped me a lot。 Now I want to create a project through this framework implementation that includes multiple pages. can you give me some adivce?

Answers (3)

👍 Most helpfulinventorbitAugust 1, 2018

You can make use of the following

{
	current: 1,
	pages: [
		{ components: [], style: [] },
		{ components: [], style: [] },
		...
	]
}

When you change the page, at first you store the current template:

const currentPage = pages[currentIndex];
currentPage.components = editor.getComponents();
currentPage.style = editor.getStyle();

and then you change the editor with the next one

const nextPage = pages[nextIndex];
editor.setComponents(nextPage.components);
editor.setStyle(nextPage.style);

Reference Link: https://github.com/ronaldaug/gramateria/issues/2

ionic666August 2, 2018

@inventorbit It's a really great solution

lock[bot]September 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.