sample - Liquid Filter Reference - 0.10.11

Filter Name sample
Group Collections
Version 0.10.11

Description

Returns a random sample in random order of all the values for a given collection

Examples

When a number property is provided, it returns random selection of the size of the number provided of the values from the collection:
{{ items | sample: 2 | join: ", " }}
4, 8

Back to Filter List

Back to Liquid Reference for 0.10.11

 

 
Back to Documentation