I'm trying to check to see if a particular category (In a loop) exists in a query submitted from a search form.
At the moment I'm doing this inside a 'childCategory' loop...
{% for childCategory in childCategories %}
{% for category in query %}{% if childCategory.slug == category.slug %} checked{% endif %}{% endfor %}
{% endfor %}
EUGH right?
Is there a better way (Surely!) to check to see if the cateogry exists? I've tried the length and indexOf filters as well as an IN conditional. Nothing works.
The query is being set like this:
{% set query = craft.request.getParam('category') %}
{% set queryCategories = craft.categories.group('opportunities').slug(query) %}