Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Documentation on Forms seems to be Incorrect

form

Started by Richard Hainsworth 6 years ago · 0 replies · 540 views
6 years ago

Been working on this problem of mine /forum/general/obtaining-a-form-object-for-use-in-a-twig-template-t2313

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

TWIG
{% 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.

Suggested topics

Topic Participants Replies Views Activity
General · by jean-louis67, 3 weeks ago
2 307 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 310 3 weeks ago
General · by Veehem, 4 weeks ago
0 263 4 weeks ago
General · by milkboy, 4 weeks ago
0 264 4 weeks ago
General · by ian russell, 1 month ago
2 335 1 month ago