multipage manager [request]
jaronwanderley opened this issue ยท 7 comments
I do not know if it is possible, but I would like to request some implementation of pages manager, duplicating them or creating new ones from the beginning.
@jaronwanderley Sorry for late response.
Yea, It's the option that I want GrapesJs to implement too.
As Gramateria is based on GrapesJs, I'm still trying figure out how to implement the multipage option.
I hope @artf (grapesjs core developer) adds it soon.
The multipage option is on their roadmap, you can read here.
But currently you can try a newly launched "Gramateria dashboard" here
There is no multipage option yet but you can still save your projects on cloud.
Hi @ronaldaug, first of all, thanks for using GrapesJS in your project, I really like it. About Page Manager, unfortunately, we have not yet started working on it, but I think you could start creating something similar without much effort. For example, 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);
@artf Could you sent some sample code for multiple page?
Where do you add the component in the new version of Newsletter ? In what file ?