I’ve followed the cookbook about creating pages from frontend. It’s working great. But now I have a situation where on template I show all the events with their form. So there are more then 10x the same form on a page. What would be the best approach to make this work?
What is your use case? Why do you need 10x the same form? I don’t quite understand, I’m afraid?
I have a page that displays all the upcoming events. Every event has his own form to make a reservation for that event. All on one page. It’s a simple reservation, just name and email.
Other option would be that all events link to 1 reservation page. So then the event ID needs to be passed to the registration controller.
Don’t include the form in the events.php template. Make that template just a simple foreach that produces a list of link tags that link to that respective event.php template, and include the form on that page.
I’d choose one of those alternatives, either a separate reservation page or the form on each event page (with a Register link under each event), that’s much cleaner than having thousands of forms on a single page. The second option with the form in the single events page is actually preferable, then you don’t have to pass the event ID.
Yes I agree, I’m thinking to complex here. Let keep things simple
I went with the single event page. So the reservation button on the event listing will link to that with an anchor leading to the form at the bottom of the page.
Thanks for your help and insight!