You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Tera, template outside of blocks is completely ignored in children. The way to do it here is to define a block in your parent template and override it in the children. Eg
{% block extra_data %}
// In tera unknown values are an error so it should be set to something if it's possible that it never gets set in a children.
{% set foo = "" %}
{% endblock %}
... and in the children
{% block extra_data %}
{% set foo = "bar" %}
{% endblock %}
should work and you should be able to use {{foo}} after the extra_data block
I cannot pass a variable from a child template to it's parent.
I have this in
child
:And I'm trying to use the
foo
variable fromparent
:When I try to render
child
, I get an error sayingfoo
isn't in scope:Jinja appearently can do this: https://jinja.palletsprojects.com/en/3.0.x/tricks/#highlighting-active-menu-items
Note: I'm using Tera with Rocket.
The text was updated successfully, but these errors were encountered: