]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
1 | ``block`` |
2 | ========= | |
3 | ||
4 | When a template uses inheritance and if you want to print a block multiple | |
5 | times, use the ``block`` function: | |
6 | ||
7 | .. code-block:: jinja | |
8 | ||
9 | <title>{% block title %}{% endblock %}</title> | |
10 | ||
11 | <h1>{{ block('title') }}</h1> | |
12 | ||
13 | {% block body %}{% endblock %} | |
14 | ||
15 | .. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` |