From: Armin Ronacher Date: Sun, 11 May 2008 21:55:02 +0000 (+0200) Subject: documented recursive loops X-Git-Tag: 2.0rc1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1de4c644c91e94b97e2a95e318a005dc617ccebf;p=thirdparty%2Fjinja.git documented recursive loops --HG-- branch : trunk --- diff --git a/docs/templates.rst b/docs/templates.rst index ea19e2d5..90d4099d 100644 --- a/docs/templates.rst +++ b/docs/templates.rst @@ -455,6 +455,22 @@ by using `else`:: {% endif %} +It is also possible to use loops recursively. This is useful if you are +dealing with recursive data such as sitemaps. To use loops recursively you +basically have to add the `recursive` modifier to the loop definition and +call the `loop` variable with the new iterable where you want to recurse. + +The following example implements a sitemap with recursive loops:: + + + If ~~