]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Update docs/templates.rst 159/head
authorDimitris Leventeas <mydimle@gmail.com>
Thu, 1 Nov 2012 22:21:32 +0000 (23:21 +0100)
committerDimitris Leventeas <mydimle@gmail.com>
Thu, 1 Nov 2012 22:21:32 +0000 (23:21 +0100)
Loop (recursive) --> Another loop -> loop(...)

docs/templates.rst

index 790b95e7c24908ff083291ad8e338ca6396b0685..138131452465c9d3742be494150a82d66c5ca845 100644 (file)
@@ -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
 ~~