Kaydet (Commit) 278a09ac authored tarafından kapil garg's avatar kapil garg Kaydeden (comit) Tim Graham

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

üst 9b538bad
...@@ -407,6 +407,13 @@ Here are some tips for working with inheritance: ...@@ -407,6 +407,13 @@ Here are some tips for working with inheritance:
not be automatically escaped (see the `next section`_), since it was not be automatically escaped (see the `next section`_), since it was
already escaped, if necessary, in the parent template. 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 * For extra readability, you can optionally give a *name* to your
``{% endblock %}`` tag. For example:: ``{% endblock %}`` tag. For example::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment