-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: HTML elements ids are incremented on different pages loaded in projectData #4837
Comments
Even with multiple pages all components have to maintain a unique id across whole project. |
My use case might explain how I had this result. I am building a CMS using GrapesJS as a Page Builder. I can live without ids at the moment, this is just something I noticed in my multiple tries. I might open a discussion where we could speak more about this CMS I'm building. I'd be glad to have your opinions and advices on my design choices. |
I'm wondering if it would make sense to you generating each page separately |
At first, I wanted to generate all the pages together to have a single CSS output for all the pages. But now I'm trying another solution for the styles. So for the |
I have a question regarding the StoreManager, if users start creating many pages, at what point does performance start to be lost? , taking into account that you must store the assets, and the styles and taking into account how you could store this information in a database without affecting the load of the API when processing so much information |
Hello |
I like this idea 💯 |
I also have a use case where the content is initially generated outside of the editor so different pages can have elements with the same id.
Is it possible to relax this constraint so that ids are namespaced by pages? |
GrapesJS version
What browser are you using?
Firefox 109
Reproducible demo link
https://grapesjs.com/demo.html
Describe the bug
Hello,
I noticed that when I load multiple pages in the projectData that have the same
id
used in the HTML, grapes will automatically increment theid
on every page even though these are different pages.To demonstrate this issue, you will find a piece of code below where I init grapesjs with a
projectData
containing two pages using identical ids on some HTML tags.On the resulting HTML list, you can see the ids like
body
andmain-title
are incremented tobody-2
andmain-title-2
on the second page.The
pages
result:Code of Conduct
The text was updated successfully, but these errors were encountered: