Show entries by a certain category AND certain lightswitch Just thinking of an easy way for the user to manage products on a site.

Therefore is it possible to display entries by a category and a lightswitch toggle?

IE. Category selected is Photocopiers and Lightswitch is color?

Then check for those and display the entries? Stuck on the syntax:

{% set category = craft.categories.slug('copier') %}
{% set colortype = craft.entries().section('products').color(true).all() %}
{% set entries = craft.entries.section('products').relatedTo(category).find() 

*Stuck on the syntax here to add to the query the lightswitch field*

 %}




    {# If there are any entries, loop through them #}
    {% if entries | length %}

        {# For each entry we find, do this #}
        {% for entry in entries %}
            &lt;p&gt;{{ entry.title }}&lt;/p&gt;
        {% endfor %}

{% endif %}


TIA :)
You can add the lightswitch filter to the entries query like so:

{% set category = craft.categories.slug('copier') %}
{% set entries = craft.entries()
                      .section('products')
                      .relatedTo(category)
                      .color(true)
                      .all() %}

{# If there are any entries, loop through them #}
{% if entries | length %}

    {# For each entry we find, do this #}
    {% for entry in entries %}
        &lt;p&gt;{{ entry.title }}&lt;/p&gt;
    {% endfor %}

{% endif %}