blob: 158bac78b1e08b9e5622f25780a5d06564c7c44e [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``parent``
2==========
3
4When a template uses inheritance, it's possible to render the contents of the
5parent block when overriding a block by using the ``parent`` function:
6
7.. code-block:: html+twig
8
9 {% extends "base.html" %}
10
11 {% block sidebar %}
12 <h3>Table Of Contents</h3>
13 ...
14 {{ parent() }}
15 {% endblock %}
16
17The ``parent()`` call will return the content of the ``sidebar`` block as
18defined in the ``base.html`` template.
19
20.. seealso::
21
22 :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>`