Issue #3206✓ SolvedOpened December 23, 2020by jrkd6 reactions

Page Manager Plugin

快速解答by artf5

The Pages module is now merged https://github.com/artf/grapesjs/pull/3411 and the new version will be soon released. A simple demo using the Pages API: https://codepen.io/artf/pen/XWpJQoY

Read full answer below ↓

Question

Feature: The ability to create multiple pages in Grapesjs.

Functional design

Globally:

  • Include a link to the right of 'Device [dropdown list]' in the top banner that says 'Current Page: <page-name>'
  • Include a new menu item to the right of 'Blocks' in the right column. The icon will be something like the FA pages icon.
  • Clicking either the menu item or current page link, displays the 'Page Manager' tab; a full width list of links that switch between pages.

Page Manager Tab:

  • The current page will be highlighted in the list.
  • Clicking a new page refreshes the main view and associated editor details.
  • The current device settings should be maintained.
  • The export/preview/layout/attributes functionality should refer to the newly selected page.
  • Each page in the list will have a bin icon to delete, after a confirm dialog, this will be removed.

Visual design

  • Links & text will use existing sizes/colors/classes as other components
  • Page manager tab items will look similar to a top level tree item in the Layer Manager, but with a bin icon rather than a re-order/eye icon.
  • New icons will be from the existing set of font awesome icons and highlighted in the same way.

Technical details

  • Will be added via a plugin.
  • The pages data will be stored similar to how page data is currently saved using the existing storage manager, but under a different key.

Starter comments from @artf ;

From @artf's comment on a forked repo :

You can start from an array of pages and the index of the current one.

{
	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);

Is there an alternative at the latest version? No

Related Issues

Answers (4)

artfDecember 31, 2020

Sounds great, I really like the idea of having this one as a plugin, so if you think we need something to add (eg. some event) to make it work better, let me know.

jrkdDecember 23, 2020

Got the core of this functionality working this arvo.

@artf Let me know if this is still desired and I'll spend some more time on it in Jan.

Note to self, TODO: add/remove page actions, visual tweaks, integrate with the storage manager & refactor code as a standalone plugin.

ClaudeCodeMay 17, 2026

Thanks for reporting this, @jrkd.

Great suggestion about FEAT: Page Manager Plugin! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior.

Using the event system:

editor.on('component:update', (component) => {
  // your logic here
});

Alternative approaches:

  • Listen to selector:add for CSS selector changes
  • Use selector:custom for custom rules
  • Tap into the change:* events for fine-grained tracking
  • Build a plugin that extends the editor with this capability

Making it official: If this feature would benefit many users, consider opening a formal Feature Request on the GrapesJS repo with:

  • A detailed use case
  • Code example showing the desired behavior
  • Why this matters for your workflow

The core team is receptive to well-motivated feature requests backed by real use cases.

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.