Twig Components / Methods / parent
Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?
parent
is a Twig function to render the contents of the parent block when overriding a block by using the parent
function, when a template uses inheritance.
{% extends "base.html" %}
{% block sidebar %}
<h3>Table Of Contents</h3>
...
{{ parent() }}
{% endblock %}
The parent()
call will return the content of the sidebar block as defined in the base.html
template.
See alsoΒΆ
Source: Twig
Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.