Been working on this problem of mine Obtaining a form object for use in a twig template
It states clearly in the main Grav documentation (see https://learn.getgrav.org/16/forms/forms#displaying-forms-from-twig) that a form can be obtained from another route with
{% include "forms/form.html.twig" with { form: forms('contact-form') } %}
But the variable forms
is not available as a Twig variable. So the code in the Documentation will not work in another Twig template or on page (I have tested this code in both a twig template and a form.md page).
Looking deeper:
The variable form
is available and it is set in the plugin code (/user/plugins/form/form.php
) in the function onTwigVariables
, but forms
is not set there.
This means that there is a disconnect between the Documentation and the implementation of the Form plugin.
If there is another way to access a form on another page, it is not documented - I think. I have been looking at this for a while, and I could have missed something.