events
events copied to clipboard
Custom, dynamic fields for new ticket types
Client needs the ability to collect information for each ticket that will vary quite a bit from event to event. As it stands, our best options are as follows:
- Create a dynamic template on the front-end that will display whatever fields are on the template while showing them how to create new fields and ticket types as needed to fulfill their needs.
- Create a preset list of ticket types, giving them as many options as possible, but restricting them to pre-created ticket types.
Both of these options have their drawbacks. For option 1, this requires them to get more into the weeds of field creation and layout than they have previously. They're fairly familiar with the platform, and have used custom field creation in Freeform, but this type of field creation freedom is something we'd generally keep to the dev team.
The second option keeps the client away from having to get that deep into craft mastery but also has the obvious drawback of limiting the customizability, something they'd like to have.
Is there another option you're aware of, either with just this plugin or pairing it with another plugin, that would give us more freedom to have truly custom dynamic ticket types here?
In similar scenarios, we've often created a textarea field to contain complex content on the ticket type. When you're templating, it's totally up to you how you handle this (a textarea, Vue component, repeater). Because of the freedom of using line item options to store anything against a ticket being purchased, you can go crazy with what content to store.
Some examples we've done:
- A customer needs to provide what size jacket and helmet they need - these are two text fields
- A customer must provide all attendees contact details (for contact tracing) this is a Vue component that allows users to click "add" and enter name/phone/email of attendees. This is stored as a JSON blog in a multi-line text field
That takes care of capturing the data from the user. It terms of displaying it in the control panel, I might also suggest writing a custom field to process the data (probably saved as a JSON blob) to whatever client needs you have.
But that doesn't quite handle the case of being able to give your client the freedom to set what sorts of fields users need to provide. There's a couple of ways to do this in a client-friendly way I think.
- Matrix or Super Table field. Inner fields could be "Field Type" (dropdown, text, radio, etc) and "Value" - or whatever works for your needs to keep it flexible for your client.
- Freeform/Formie
For both cases this is just the content-management side of things, allowing your client to setup what to ask the user for, or what information to display on the ticket page. The templating here can be whatever you like.
Then, you'd capture this information into line item options. The benefit of using Matrix/Super Table option is that you could serialize it in the correct manner (that the respective fields need their data saved as), and Events will add the content set in a line item to the Matrix/Super Table field on the ticket, so your client can see the fields populated with user data. You wouldn't get that with a form plugin.
Long explanation - but I hope that helps somewhat?
@engram-design I just wanted to circle back on this. I've implemented the matrix solution you suggested to allow the client to create their own flexible fields on a per ticket basis. Little complex getting it all to work, but I have the info passing through the options array and into the purchased ticket objects at the end of the process so that you can see the entered data.
This turned out to be exactly the solution that I needed. Thank you.