If I define a block inside a block in a Jinja template, and extend it, How do I reference the nested block in the child template?
You reference the nested block the same way you reference any block, e.g., given
{% block outer_block %}
Outer things
{% block inner_block %}
Inner things
{% endblock %}
More outer things
{% endblock %}
You'd override inner_block
with
{% block inner_block %}
customized inner content
{% endblock %}
Can you clarify what problem you're encountering? Or are you running into scoping issues, e.g., http://jinja.pocoo.org/docs/templates/#block-nesting-and-scope ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With