sample - Liquid Filter Reference - 0.11.4

Filter Name sample
Group Collections
Version 0.11.4

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

 

 
Back to Documentation