Skip to content Skip to footer navigation

Doesn't Overlap Modifier

The inverse of overlaps. Returns true when none of the needle values are found in the haystack array, otherwise false.

The first parameter is the "needle" to compare against the "haystack". It will read from the context if there is a matching variable, otherwise it will use the parameter as the value. The needle can be a single value or an array.

shopping_list:
- eggs
- flour
- beef jerky
avoid:
- kale
- tofu
{{ if shopping_list | doesnt_overlap('avoid') }} All clear! {{ /if }}
{{ if shopping_list | doesnt_overlap('flour') }} Nope, there's flour. {{ /if }}
@if (Statamic::modify($shopping_list)->doesntOverlap('avoid')->fetch()) All clear! @endif
@if (Statamic::modify($shopping_list)->doesntOverlap('flour')->fetch()) Nope, there's flour. @endif
All clear!