Hi, I’m trying to understand how the form works and how do I make it work.
While everything until this step was easy to understand and logic, and i have been able to set up a modular page, i got a little confused fallowing the “Forms in modular pages” tutorial. Maybe it’s because i’ve skipped the other tutorials for the forms for back-end section but i didn’t really need them.
I have been able to setup a small form on the contact page, and looked easy. After that i tried to do the modular form:
Based on the documentation It was not clear if i had to copy the files:“templates/form.html.twig” and “templates/formdata.html.twig” from the antimatter theme to the templates folder of my theme or to the “templates/forms” folder. So i tried to copy in both places ( it returned an error later and i replaced the form.html.twig in the “templates/forms” folder with the same one located in the antimatter theme ).
The form is suposed to show in my modular homepage so i created a file called form.md with:
in my 01.home/_footer/form.md
In 01.ho me/default.md I have added:
title: Homepage menu: Home onpage_menu: true body_classes: "modular" content: items: @self.modular order: by: default dir: asc custom: - _intro - _continut - _parteneri - _footer form: action: /home name: homepage_form fields: - name: name label: Name placeholder: 'Enter your name' autofocus: 'on' autocomplete: 'on' type: text default: test buttons: - type: submit value: Submit process: - message: 'Thank you for your feedback!'
checking the result it seems it just loads an empty form with “/grav/home/_footer” in the action . Before coming here and asking for help i did my best to solve this problem by myself, but i’m not able to see how this work, maybe it’s the fact that i have a Wordpress developement background and i’m limited.