Skip to content

Commit

Permalink
Note about nesting blocks and {% endblock NAME %}
Browse files Browse the repository at this point in the history
| Q             | A
| ------------- | ---
| Doc fix?      | [yes]
| New docs?     | [yes] 
| Applies to    | [2.3]
| Fixed tickets | []
  • Loading branch information
ThomasLandauer authored and wouterj committed Dec 19, 2015
1 parent 41f7e6f commit 9cd391b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cd391b

Please sign in to comment.