diff --git a/book/templating.rst b/book/templating.rst index 62500e250bb..b1fa09bb865 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -370,6 +370,19 @@ When working with template inheritance, here are some tips to keep in mind: {{ parent() }} {% endblock %} +* Blocks can be nested. For better overview, you can add the block name to the + ``{% endblock %}`` tag like so: + + .. code-block:: html+jinja + + {% block foo %} + {# ... #} + {% block bar %} + {# ... #} + {% endblock bar %} + {# ... #} + {% endblock foo %} + .. index:: single: Templating; Naming conventions single: Templating; File locations