summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDimitris Leventeas <mydimle@gmail.com>2012-11-01 23:21:32 +0100
committerDimitris Leventeas <mydimle@gmail.com>2012-11-01 23:21:32 +0100
commitaa023e4947728c3797f5d506f6ddd174bd49a3f5 (patch)
tree0d6388886f083cd5b56543f73e938c8f0ee7f336 /docs
parent21a2010bf2768bc658e09666c2135063ce004efc (diff)
downloadjinja2-aa023e4947728c3797f5d506f6ddd174bd49a3f5.tar.gz
Update docs/templates.rst
Loop (recursive) --> Another loop -> loop(...)
Diffstat (limited to 'docs')
-rw-r--r--docs/templates.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/templates.rst b/docs/templates.rst
index 790b95e..1381314 100644
--- a/docs/templates.rst
+++ b/docs/templates.rst
@@ -588,6 +588,10 @@ The following example implements a sitemap with recursive loops::
{%- endfor %}
</ul>
+The `loop` variable always refers to the closest (innermost) loop. If we
+have more than one levels of loops, we can rebind the variable `loop` by
+writing `{% set outer_loop = loop %}` after the loop that we want to
+use recursively. Then, we can call it using `{{ outer_loop(...) }}`
If
~~