Skip to content

Can't have forms shared across many pages #123

Open
collective/collective.volto.formsupport
#76
@djay

Description

@djay

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions