Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (15 sloc) 1.111 kb
b11a84e @kaos doc: rearranged ref docs to include the meta doc.
kaos authored
1
47ef7b4 @kaos doc: migrated docs for a few tags.
kaos authored
2 .. index:: tag; overrules
3 .. _tag-overrules:
4
5 overrules
6 =========
7
8 Inherit markup from like named template in another module.
9
10 Signal that this template extends a template with the same name in a module with lower priority.
11
12 The `overrules` tag must be the first tag in the template.
13
84ee423 @mworrell docs: minor change for overrules docs.
mworrell authored
14 .. note:: A template that overrules another template contains only the :ref:`tag-overrules` tag and :ref:`tag-block` tags.
47ef7b4 @kaos doc: migrated docs for a few tags.
kaos authored
15
16 Example, say a template "page.tpl" contains the following::
17
18 {% overrules %}
19 {% block title %} My new title {% endblock %}
20
21 All named blocks in this template will replace the similar named blocks in the template `page.tpl` that is "next in line" to be used.
22
23 This is useful if you want to use a template from a module, and the template is mentioned in (for example) a dispatch rule. Now you can overrule and extend that template in your own modules without changing the dispatch rules or the original module.
24
25 Make sure your module has a higher priority (lower number) than the module containing the overruled template.
26
27 .. seealso:: :ref:`tag-block`, :ref:`tag-inherit` and :ref:`tag-extends`.
Something went wrong with that request. Please try again.