Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Consider this structure, used with latest Jinja from installed from PIP:
- `base.html`
- {% set var1 = True %}
- {% set var2 = True %}
- {% block one %}{% endblock %}
- `index.html`
- {% extends 'base.html' %}
- {% block one %}
- {% if var1 %}
- {% include 'table.html' %}
- {% endif %}
- {% endblock %}
- `table.html`
- {{ var1 }}{{ var2 }}
- When rendering index.html, it shows only 'True ' (= nothing for `var2`)
- If I modify `index.html` to be :
- {% extends 'base.html' %}
- {% block one %}
- <!-- {{ var2 }} -->
- {% if var1 %}
- {% include 'table.html' %}
- {% endif %}
- {% endblock %}
- Then everything is fine in `table.html` and the 2 vars show correctly.
- Using {% include 'table.html' with context %} doesn't resolve the problem.
- What did I miss ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement