multiple page manager resets device manager
Question
Hi, I have a small issue with the page manager. I want all the pages to have a fixed resolution. Height and width figures come from an API and I can successfully display the desired resolution on the single page template.
However on the multiple page template, once I switch to a different page, the device manager is reset to full screen (default). How can I achieve my aim, so that the desired resolution are correctly displayed through out all pages.
Please see below my code in React js:
useEffect(() => {
const editor = grapesjs.init({
container: "#editor",
blockManager: {
appendTo: "#blocks",
},
styleManager: {
appendTo: "#styles-container",
sectors: [
{
name: "Dimension",
open: false,
buildProps: ["width", "min-height", "padding"],
properties: [
{
type: "integer",
name: "The width",
property: "width",
units: ["px", "%"],
defaults: "auto",
min: 0,
},
],
},
],
},
layerManager: {
appendTo: "#layers-container",
},
traitManager: {
appendTo: "#trait-container",
},
selectorManager: {
appendTo: "#styles-container",
},
panels: {
defaults: [
{
id: "basic-actions",
el: ".panel__basic-actions",
buttons: [
{
id: "visibility",
active: true, // active by default
className: "btn-toggle-borders",
label: '<i class="fa fa-clone"></i>',
command: "sw-visibility", // Built-in command
},
],
},
{
id: "panel-devices",
el: ".panel__devices",
buttons: [
{
id: "device-desktop",
label: '<i class="fa fa-television"></i>',
command: "set-device-desktop",
active: true,
togglable: false,
},
{
id: "store-data",
label: '<i class="fa fa-save"></i>',
command: "store-template",
togglable: false,
},
],
},
],
},
deviceManager: {
devices: [
{
name: "Desktop",
width: `${width}px`,
height: `${height}px`,
},
],
},
storageManager: {
...
},
plugins: [gjsBlockBasic],
pluginsOpts: {
gjsBlockBasic: {},
},
pageManager: true,
});
const pageManager = editor.Pages;
editor.on("load", () => {
setPages([...pageManager.getAll()]);
});
editor.Commands.add("set-device-desktop", {
run: (editor) => editor.setDevice("Desktop"),
});
setEditor(editor);
}, [slugId]);
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4621
BUG: No Option found for showing multiple pages on a single canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link NO LINK Desc...
Issue #3206
FEAT: Page Manager Plugin
Feature: The ability to create multiple pages in Grapesjs. Functional design Globally:[ ] Include a link to the right of 'Device [dropdown...
Issue #3455
BUG: Style gets wiped out when inserting components in multiple page using Page Manager
Version: 0.17.3 What is the expected behavior? Style should be retained across multiple pages Describe the bug detailed We have use case wh...
Issue #3403
Multi page manager
How can I create multiple pages?
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.