1๐
โ
I ended up adding an import
under the extends
, and it works so far.
Working example :
parent.j2
{% set foo = foo|default("foo") %}
{% set from_parent = "ok" %}
child.j2
{% extends 'parent.j2' %}
{% import 'parent.j2' as parent with context %}
{% set foo = "bar" %}
{% set to_child = parent.from_parent %}
Output :
foo : "bar"
to_child : "ok"
๐คksm101
Source:stackexchange.com