diff options
author | David Smith <smithdc@gmail.com> | 2020-06-23 06:57:19 +0100 |
---|---|---|
committer | Carlton Gibson <carlton@noumenal.es> | 2020-08-05 11:36:14 +0200 |
commit | 2c2f4b37997daf84834547c8abd146cd6e9eac13 (patch) | |
tree | adbd3dbeacca8f8cb3117eef1deca06b1fdf22aa /docs/ref/templates | |
parent | e70dc506d76083e443a37bac5058151823802e29 (diff) | |
download | django-2c2f4b37997daf84834547c8abd146cd6e9eac13.tar.gz |
Fixed #29336 -- Doc'd circular template inheritance
Diffstat (limited to 'docs/ref/templates')
-rw-r--r-- | docs/ref/templates/language.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/templates/language.txt b/docs/ref/templates/language.txt index 2a956f082c..d46a991c9e 100644 --- a/docs/ref/templates/language.txt +++ b/docs/ref/templates/language.txt @@ -407,6 +407,13 @@ Here are some tips for working with inheritance: not be automatically escaped (see the `next section`_), since it was already escaped, if necessary, in the parent template. +* By using the same template name as you are inheriting from, + :ttag:`{% extends %}<extends>` can be used to inherit a template at the same + time as overriding it. Combined with ``{{ block.super }}``, this can be a + powerful way to make small customizations. See + :ref:`extending_an_overridden_template` in the *Overriding templates* How-to + for a full example. + * Variables created outside of a :ttag:`{% block %}<block>` using the template tag ``as`` syntax can't be used inside the block. For example, this template doesn't render anything:: |