From fdb9aad4ebb36dc82f057849a65fc4bf524285b9 Mon Sep 17 00:00:00 2001 From: Mike Bridge Date: Thu, 2 Apr 2015 09:27:42 -0600 Subject: [PATCH] Updated Liquid for Designers (markdown) --- Liquid-for-Designers.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Liquid-for-Designers.md b/Liquid-for-Designers.md index 4c862ae..65c9081 100644 --- a/Liquid-for-Designers.md +++ b/Liquid-for-Designers.md @@ -331,6 +331,17 @@ numbers: # results in 1,2,3,4 ``` +A for loop can take an optional `else` clause to display a block of text when there are no items in the collection: + +```liquid + # items => [] + {% for item in items %} + {{ item.title }} + {% else %} + There are no items! + {% endfor %} +``` + ### Variable Assignment You can store data in your own variables, to be used in output or other tags as