From: Dimitris Leventeas Date: Thu, 1 Nov 2012 22:21:32 +0000 (+0100) Subject: Update docs/templates.rst X-Git-Tag: 2.7~49^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa023e4947728c3797f5d506f6ddd174bd49a3f5;p=thirdparty%2Fjinja.git Update docs/templates.rst Loop (recursive) --> Another loop -> loop(...) --- diff --git a/docs/templates.rst b/docs/templates.rst index 790b95e7..13813145 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -588,6 +588,10 @@ The following example implements a sitemap with recursive loops:: {%- endfor %} +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 ~~