grav-plugin-form
grav-plugin-form copied to clipboard
Form does not work when defined in pages that redirects
I know this is an edge usecase:
/map
/restaurants -> /map (redirect)
/restaurants/pizza
/restaurants/hamburger
I want to define one global form that gets reused in every subpage using:
{% include "forms/form.html.twig" with { form: forms('restaurant_contact') } %}
I've set action
to #contact
, so the form redirects to the page itself rather than the page where the form got defined. This all works well unless the page where the form is defined redirects to another page using redirect: '/map[307]'
. The browser shown a redirection error. Not sure if this is intended, but I need to place the form to any other page now.
Is there a way to define a form in twig maybe, or at least in some yaml file that gets loaded instead of adding the form to a page?