Skip to content
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

Can't have forms shared across many pages #123

Open
djay opened this issue Jan 22, 2025 · 0 comments
Open

Can't have forms shared across many pages #123

djay opened this issue Jan 22, 2025 · 0 comments
Assignees

Comments

@djay
Copy link
Member

djay commented Jan 22, 2025

Current submission requires adapting the current page, reading the schema from the blocks on the page and also storing data inside the dx page object (if enabled)

This has many problems.

  • you cant use slots or layouts or another method to have a form on many pages
  • your data is stored all over the site so hard to manage centrally
  • moving a form between pages will lose the data

proposed solution

store data at site root keyed by block Id

  • also store a copy of the form schema in the same place. On page save.
  • on submission you validate against store schema not against the page block
  • optimally could support a form id so you could potentially copy forms and have them save to the same store. But you would need to make sure the schemas don't conflict. This could be helpful to have different versio s of a form that include additional information depending on context.

Pros

  • not hard to change the code. Already keyed by blockid
  • allows for a control panel to manage the data later.
  • doesn't require a option to enable. Data can be moved as you go.

Cons

  • blockid might not be the right key since it changes when copying blocks between pages?
  • less clear what happens to the data when you delete the page. Do we subscribe to it the event and remove it? Or leave it to as some admin function to clean up?

other solutions considered

embed form block

  • have another block where you pick a form from another page.
  • cons - confusing for the the user and you still end up with your data all over
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants