ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Selectable blueprints when creating a new form

Open motion-work opened this issue 3 years ago • 7 comments

When creating a new form /cp/forms/create, it would be great to have predefined blueprints to select from. I'm thinking of a dropdown like in the form config page where we can select the mail template.

For example we could create a form XY, with an email field predefined and another with the phone field.

Is something like this already in the planning?

motion-work avatar Aug 02 '22 14:08 motion-work

Not something we've been planning. We don't provide predefined blueprints anywhere else. You have complete control over them.

You could just copy/paste a yaml file from another project.

jasonvarga avatar Aug 02 '22 14:08 jasonvarga

Not sure what you mean by "We don't provide predefined blueprints anywhere else". When I want to create a new page, I already have the ability to select a predefined blueprint. Like so: Screenshot 2022-08-02 at 16 56 05

It would be great to have the exact same functionality when creating forms. Also a normal user (our clients), who is not an developer can't copy/paste a yaml file.

motion-work avatar Aug 02 '22 14:08 motion-work

Maybe I'm misunderstanding what you're asking.

Creating a new form is the "container". Like how creating a new collection is the container for entries. When you create a collection, you don't have any blueprints to choose from. You create the blueprints.

jasonvarga avatar Aug 02 '22 15:08 jasonvarga

Oh, you're letting your client create new forms?

jasonvarga avatar Aug 02 '22 15:08 jasonvarga

Yes, in our case we want the client to be able to create his own forms. Here's an example:

They want to create a public event page, where users can sign up for an event XY. This sign up form can vary from event to event (always different fields are required). For some special events, he needs to collect the mail address from the user, so the user gets an email confirmation. But it's not trivial just to say "Hey, don't forget to add the email field in the form builder". We want it to be predefined for him. So he can select a "Event Form Blueprint" or "Team Event Form Blueprint".

motion-work avatar Aug 02 '22 15:08 motion-work

I have a similar problem. Our customers need to create their own forms, so I have created a collection that is used as a form builder. These entries are then used to create an actual Statamic form. I can't offer my clients to use the built-in form builder because it either provides too many options, too few options, or because the idea of Blueprint (fields) doesn't necessarily apply to front-end work. For example, I need a form field to store more attributes because of design requirements, like pre-defined widths or other design options. One nice feature I added is that the user can define a custom HTML mail (instead of selecting hard coded template files) and use all the form fields as variables. This is all a bit hacky, but it works.

@motion-work We could have a private discussion on this or other Statamic related stuff, if you like. You are also from the same beautiful city in Switzerland, as I see, so you could come by for a coffee ;)

morhi avatar Oct 03 '22 09:10 morhi

Hi Maurice. That's a really creative use of collections! I'll definitely hit you up via mail! Hope to see you soon here in Berne.

motion-work avatar Oct 05 '22 06:10 motion-work