# inherit

Source: https://zotonic.com/docs/1370/inherit

URI: https://zotonic.com/id/1370

Language: en



::: {.aside}
See also

<a href="/id/doc_template_tag_tag_block" class="doc-reference doc-reference-tag"><code>tag#block</code></a>, <a href="/id/doc_template_tag_tag_extends" class="doc-reference doc-reference-tag"><code>tag#extends</code></a>, <a href="/id/doc_template_tag_tag_fragment" class="doc-reference doc-reference-tag"><code>tag#fragment</code></a> and <a href="/id/doc_template_tag_tag_overrules" class="doc-reference doc-reference-tag"><code>tag#overrules</code></a>.
:::

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

Say you have a template `hello.tpl` containing:

templates/hello.tpl

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

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

templates/world.tpl

```django
{% 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:

```erlang
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:

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

The `with` keyword is optional:

```django
{% inherit with who="world" %}
```

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

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1370?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1370?language=en>)
