1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

[1.11.x] Fixed #27730 -- Doc'd that template vars created outside a block can't be used in it.

Backport of 278a09ac1f from master
This commit is contained in:
kapil garg
2017-04-27 00:24:57 +05:30
committed by Tim Graham
parent 4678957b4e
commit 8a1340ea11

View File

@@ -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::