inherit

Include the markup of an extended template into the extending template.

Say you have a template hello.tpl containing:

templates/hello.tpl

{% block test %}
This is content from hello.tpl
{% endblock %}

And in your site you have a world.tpl template, defined as:

templates/world.tpl

{% extends "hello.tpl" %}
{% block test %}
    First line
    {% inherit %}
    This is more content from world.tpl
{% endblock %}

Then, the result of rendering the template world.tpl will be:

First line
This is content from hello.tpl
This is more content from world.tpl

Arguments

The inherit tag can pass extra variables when rendering the inherited block:

{% block test %}
    {% inherit who="world" %}
{% endblock %}

The with keyword is optional:

{% inherit with who="world" %}

The supplied arguments extend the current template context for the inherited block render.

Edit on GitHub

Referred by

Developer guide

Templates

Templates are text files marked up using the Zotonic template language. Zotonic interprets that mark-up to dynamically generate HTML pages. Zotonic’s template…

Modules

mod_admin

Admin backend module that wires the core admin interface, assets, and admin-specific event handling.