3

I currently have this working for a single range of numbers, but I can’t figure it out for multiple ranges. I currently have it set up like this for one range, and it works. myFieldHandle: ['and', '> 0', '< 10'].

Alex Glover
  • 51
  • 1
  • 2

1 Answers1

3

I'm not sure if you can do this in the same query but you can use two queries, one for each range, and then merge them, something like this:

{% set range1 = craft.entries({myFieldHandle: ['and', '> 0', '< 10']}) %}
{% set range2 = craft.entries({myFieldHandle: ['and', '> 20', '< 30']}) %}
{% set entries = range1 |merge(range2) %}
Mato
  • 229
  • 1
  • 7