Dynamic form rendering // TWIG in Frontmatter

Hey everybody !

So I’m trying to render a form with different dates that people from a volunteer team can fill up and check some checkboxes with different dates. Basically people with different accounts visit a page with a form and fill their free time to help…

For now it looks like this (please don’t mind the graphic design since I’m still struggling with the back-end issues…):

And so I’m wondering if there’s a good way to call a “for loop” with the dates using TWIG ?
Or maybe a nice plugin that I missed ?

Thank you for your help and don’t hesitate to ask if I didn’t mention important stuff in my post. Also I’ve searched a little bit in the forums and didn’t get a straight answer to my problem.

Have a nice day !
Medi

EDIT: also I would like to add that I tried to put some TWIG variables in the frontmatter… but unfortunately it led to an “rendering template” error message. Also tried to add my dates into site.yaml as an array and couldn’t call them in the form frontmatter.

I hope it helps !

(GRAV is the best)

@medi, Unfortunately, I haven’t found a way to add logic to the definition of a form…

The only option I see right now is to create your own plugin. A Twig template provided by the plugin could generate all required fields using a loop. And the PHP file of the plugin can in turn process the dynamically created fields.

1 Like

I’ll see if I can get some free help with PHP !
Hahaha

Thanks a lot for your answer !