summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorkapil garg <kapilgarg1996@users.noreply.github.com>2017-04-27 00:24:57 +0530
committerTim Graham <timograham@gmail.com>2017-04-26 14:54:57 -0400
commit278a09ac1f410cf4e3472146324feded2e2c18b3 (patch)
tree5e3c48a5056ea52a53519f1fe969e22a99fb8c4d /docs/ref
parent9b538badb1ae5d1e86779afb8be961ef5880a58a (diff)
Fixed #27730 -- Doc'd that template vars created outside a block can't be used in it.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/language.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/templates/language.txt b/docs/ref/templates/language.txt
index 430ada3a2f..6daf00043a 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::