I have a section "Hotel Room" with a field "Sleeps" (number). There is no limit on the values that can be entered. On the frontend I want a list of all existing entered values for this field. So if I have these four entries:
- sleeps=2
- sleeps=2
- sleeps=8
- sleeps=10
I want an array [2, 2, 8, 10] to iterate over. Bonus points for unique/distinct values, but I'm well aware I can add a Twig filter to array_unique()
it.
Is this possible using Craft's craft.entries
lookups within Twig?