Iteration / Looping

Developers can iterate over a collection in Parsley using the {{each}} expression.

Simple Iteration

One of the most basic examples of iteration is looping over a Zesty dataset. This example shows a list of product names being generated from a products named dataset.


When iterating a collection you can limit the number of items that are used. A great example for this would be retrieving the 5 latest blog posts.

Sort / Order

Sorting and ordering are aliases for the same operation. You can sort by a string value in which case it will sort alphabetically ascending, asc, so A-Z by default or specific descending, dsc, to sort Z-A. When sorting by an integer value it sorts ascending 0-9 by default and can be specified descending 9-0

Each Searching Zip Code Ranges

Search through items by Zip Code. Not we are using a get variable for the search. Example url

Each Within a Date Range of 3 months

An each statement useful when you want to return an archive of items from a certain past date.