ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# `parent` When a template uses inheritance, it's possible to render the contents of theparent block when overriding a block by using the `parent` function: <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1 2 3 4 5 6 7</pre></div></td><td class="code"><div class="highlight"><pre>{% extends "base.html" %} {% block sidebar %} &lt;h3&gt;Table Of Contents&lt;/h3&gt; ... {{ parent() }} {% endblock %} </pre></div></td></tr></table> The `parent()` call will return the content of the `sidebar` block asdefined in the `base.html` template. See also [*extends*](#), [*block*](#), [*block*](#)