diff options
| author | Tim Graham <timograham@gmail.com> | 2014-01-17 14:50:47 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-01-17 14:52:02 -0500 |
| commit | 4f058655d0defad179f1a92c7e2d1f282c26b1f0 (patch) | |
| tree | cff2c65840f00502414ba82db5260b44bc4ea9f6 /docs | |
| parent | b8ec3b6ddd835a66a239a4bdd5ee51b541ca09e4 (diff) | |
[1.6.x] Fixed #13116 -- Described scope of variables created by {% url ... as var %} syntax.
Thanks leif_p for the suggestion.
Backport of 4a5aac47a6 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 6a3a6bd58b..6e773f67c7 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1047,11 +1047,13 @@ cause your site to display an error page. If you'd like to retrieve a URL without displaying it, you can use a slightly different call:: - {% url 'path.to.view' arg arg2 as the_url %} <a href="{{ the_url }}">I'm linking to {{ the_url }}</a> +The scope of the variable created by the ``as var`` syntax is the +``{% block %}`` in which the ``{% url %}`` tag appears. + This ``{% url ... as var %}`` syntax will *not* cause an error if the view is missing. In practice you'll use this to link to views that are optional:: |
