I’ve been trying to use a simple form in a modular page, with no success.
With the form in modular.md, the page display is wrecked but there was a form. Putting the form in my _contact/form.md file also did not work. I was able to add cache_enable: true ok, it blows up whenever I add the form code.
email is working
Highlights is the theme
I had a working form with a different theme using standard pages
Once the page is messed up, it stays that way, even after undoing the change and clearing cache (Hurray for backups)!
title: 'Contact Us!'
media_order: 'pic03.jpg,johnny-automatic-cart-carrying-a-crate.svg'
display_title: true
next_label: Next
list_as_grid: false
cache_enable: true
form:
action: /home/_contact/
name: contact
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!'
Thanks. If I understand my issue is more css than anything else? Which makes sense, I still see the page content spilled all over the screen. If that is the case, I might have to dive deeper into grav… Or find another template with a modular form.twig
I tried what the how to suggests, copying from antimatter. There was no formdata.html.twig, but there is form.html.twig.
if your theme does not provide a templates/forms/form.html.twig file, it’s not set up to use forms, but no fear - just copy the form templates from Antimatter, the default Grav theme: