Skip to main content

List Helpers

Manipulate, loop, or repeat content from lists or objects in templates.

List

The list helper exposes all of the methods available on the Array built-in JavaScript object. You can use it to join, sort, extract, or reverse a list of values.

Here are a few examples of how you can use it.

Concat multiple values

Template
Preview
John,Doe,Briskine

Join a list values with a specific character

Template
Preview
john#doe#briskine

Sort a list of values

Template
Preview
1,2,3

Reverse a list of values

Template
Preview
c,b,a

Extract a part of a list

Template
Preview
c,d

Get a specific item from a list

Template
Preview
c

Looping

Use the each block helper to loop through a list.

Template
Preview
0: john 1: briskine.com

Random choice

Insert a random value in your template.

Template
Preview
Hi

Insert a random block of content

Template
Preview
third block of content