Questions tagged [blocks]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
2answers
31k views

Is there a way to define a global var within a twig block?

Something that would work like this: {% block A %} {% set testVar = "foo" %} {% endblock %} ... {% block B %} {{ testVar }} {% endblock %} The scope of testVar seems limited to {% block A %} I'...