I have a channel, 'pages'. Within that channel is a dropdown 'navigation'. The values in the dropdown are 'mainNavigation' and 'hidden'.
I'm trying to set an entry query that only pulls entries where the navigation value is 'mainNavigation'.
This is the code I'm using, and I'm getting no results:
{% set nav = craft.entries.section('pages').search('navigation:"mainNavigation"').all() %}
{% for link in nav %}
{{link.title}}
{% endfor %}
I know this should work. I've done it before. I copied the working code from another site, and copied the field name and value directly from the CP. I've stripped everything else out of the template. But no matter what I do, I get no results.
Has this functionality changed recently?