sample - Liquid Filter Reference - 0.11.5

Filter Name sample
Group Collections
Version 0.11.5

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.11.5

 

 
Back to Documentation