From 63b1e8b89e1709480aa2ebe65ec5b2222afa1c2e Mon Sep 17 00:00:00 2001 From: Ross Allen Date: Wed, 6 Nov 2013 20:10:33 -0800 Subject: [PATCH] Add hash iteration example --- Liquid-for-Designers.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Liquid-for-Designers.md b/Liquid-for-Designers.md index 298a707..c8d12b1 100644 --- a/Liquid-for-Designers.md +++ b/Liquid-for-Designers.md @@ -278,6 +278,14 @@ Liquid allows `for` loops over collections: {% endfor %} ``` +When iterating a hash, `item[0]` contains the key, and `item[1]` contains the value: + +```liquid +{% for item in hash %} + {{ item[0] }}: {{item[1] }} +{% endfor %} +``` + During every `for` loop, the following helper variables are available for extra styling needs: