By design, Twig macros do not have access to the context.
When the form uses display and/or email actions, all variables are being passed to data.html.twig but since its refactoring into a macro, it does not have access to the context anymore.
This can be fixed as follows:
Pass the context into the macro, by altering the top and bottom line in data.html.twig as follows:
{% macro render_field(form, fields, scope, context) %}
{# Note: Use context to access available variables #}
...
{{ macro.render_field(form, form.fields, '', _context) }}
Access the variables using context, like {{ context.base_url_absolute }}
Since data.html.twig, has been refactored with commit https://github.com/getgrav/grav-plugin-form/commit/c5902ed81845fdf80720d4273c5bbeeed1e484eb into a macro, the context variables like
base_url
are no longer accessible.By design, Twig macros do not have access to the context.
When the form uses
display
and/oremail
actions, all variables are being passed to data.html.twig but since its refactoring into a macro, it does not have access to the context anymore.This can be fixed as follows:
context
, like{{ context.base_url_absolute }}