Returns the 0-based index of the first occurrence of find in the current list or string, or -1 if it cannot be found. If start is greater than 0, the search will begin at the specified index.
index: object findInteger startBoolean ignorecase
Use the index and last_index filters to find a specific item in a list.
Find something in a list
Copyindex
last_index
Returns a string with each element from the input list joined together with the glue string between elements.
join
Use the join filter to join a list of strings together. Items in the list that are not already strings will be converted to a string before being joined together.
Join a list into a single string
CopyReturns the length of the input string or list.
size
Use the size filter to get the size of a string or a list
Using the size filter
CopyWhen used on null input
When used on a string
When used on a list
When used on anything else
Remove all duplicate objects in the input list. If property is specified, objects are considered duplicate if their property value is the same.
uniq: String propertyBoolean ignorecase
Use the uniq filter to remove duplicate items from a list.
Removing duplicates from a list
CopyUnique by property
Unique by property
Use the list methods and filters to create and manage lists of data in your templates
Getting and manipulating entity lists
CopyConcatenate and uniq the easy way
Concatenate manually
Unique manually
Get one random item from the list
Sort the full list randomly
Various ways to filter and slice
Advanced filter
Grouping
{{list.Key | default: "Unknown"}} Rooms ({{list.Value | size }} houses)
{% endfor %}Mapping and Compact
Returns the first item in the input list
first
Use the first and last filter to get a specific item in a list. In some cases, you can use square bracket notation to get an item at a specific index.
Getting a specific item from a list
Copyfirst
last
square bracket
Returns the last item in the input list
last
Use the first and last filter to get a specific item in a list. In some cases, you can use square bracket notation to get an item at a specific index.
Getting a specific item from a list
Copyfirst
last
square bracket
Reverses the input string or list.
reverse
Use the reverse filter to reverse either a string or a list
Using the reverse filter
CopyWhen used on null input
When used on a string
When used on a list
Sort objects in the input list. If the property is specified, use it to sort objects in the list. Use the special string value "random" to sort the list in a random order - which is functionally identicial to using the shuffle filter. The sort_natural filter ignores capitalization while the sort filter does not by default.
For readability and consistency, it is advised to use the sort filter with the ignorecase property set to true instead of the sort_natural filter.
sort_natural: String property
Use the sort, sort_natural, and shuffle filters to sort lists of objects. For consistency and readability, the sort filter should be preferred to the sort_natural filter.
Sorting lists
CopySort strings
Sort numbers
Sort objects
Sort randomly
Sort objects in the input list. If the property is specified, use it to sort objects in the list. Use the special string value "random" to sort the list in a random order - which is functionally identicial to using the shuffle filter.
sort: String propertyBoolean ignorecase
Use the sort, sort_natural, and shuffle filters to sort lists of objects. For consistency and readability, the sort filter should be preferred to the sort_natural filter.
Sorting lists
CopySort strings
Sort numbers
Sort objects
Sort randomly
Use the list methods and filters to create and manage lists of data in your templates
Getting and manipulating entity lists
CopyConcatenate and uniq the easy way
Concatenate manually
Unique manually
Get one random item from the list
Sort the full list randomly
Various ways to filter and slice
Advanced filter
Grouping
{{list.Key | default: "Unknown"}} Rooms ({{list.Value | size }} houses)
{% endfor %}Mapping and Compact
Split a string into a list of substrings separated by the given separator
split: String separator
Use the split filter to convert a string into a list of strings separated by the given separator
Using the split filter
CopySplit on multiple characters
Does not include empty strings in the result
Use an empty pattern to split the string into individual characters
Return a new list with the given property from every object in the input list.
map: String property
Use the map filter to map blog posts to their linked title. The map filter could just as easily be used for any other property as well.
Map a list of blog posts to their linked titles
CopyUse the list methods and filters to create and manage lists of data in your templates
Getting and manipulating entity lists
CopyConcatenate and uniq the easy way
Concatenate manually
Unique manually
Get one random item from the list
Sort the full list randomly
Various ways to filter and slice
Advanced filter
Grouping
{{list.Key | default: "Unknown"}} Rooms ({{list.Value | size }} houses)
{% endfor %}Mapping and Compact
Groups the list by the given property and returns the results as a list of objects. Each object in the result set has a Key property which is the value that they are grouped by and a Value property which is the list of objects that have the matching Key property. Any objects in the list that do not have the given property will be in a result with a null Key.
group_by: String property
Use the group_by filter to group objects by a specific property. For example, you can group a list of blog posts by blog.
Group blog posts by blog
Copy{{ group.Key.title }}: {{ group.Value | size }}
{% endfor %}Use the list methods and filters to create and manage lists of data in your templates
Getting and manipulating entity lists
CopyConcatenate and uniq the easy way
Concatenate manually
Unique manually
Get one random item from the list
Sort the full list randomly
Various ways to filter and slice
Advanced filter
Grouping
{{list.Key | default: "Unknown"}} Rooms ({{list.Value | size }} houses)
{% endfor %}Mapping and Compact