diff options
| author | kapil garg <kapilgarg1996@users.noreply.github.com> | 2017-04-27 00:24:57 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-04-26 14:55:15 -0400 |
| commit | 8a1340ea11a60c8e14e333dc92659e95ac45fe14 (patch) | |
| tree | e0d3853f4e7d2835c6ee85f54e8dbb14dd090aaf /docs/ref | |
| parent | 4678957b4efae23204d954ac912c77d7cf122f26 (diff) | |
[1.11.x] Fixed #27730 -- Doc'd that template vars created outside a block can't be used in it.
Backport of 278a09ac1f410cf4e3472146324feded2e2c18b3 from master
Diffstat (limited to 'docs/ref')
| -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 d6f13a637f..69ad5491d8 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. +* 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:: + + {% trans "Title" as title %} + {% block content %}{{ title }}{% endblock %} + * For extra readability, you can optionally give a *name* to your ``{% endblock %}`` tag. For example:: |
