Order Entries Query by a Featured Light Switch I have a case studies filter that allows you to filter case studies by category. I've attached a light switch field called 'featured' to the entries that allow you to set it as featured. The idea is to have featured case studies appear first when filter results are returned. I've seen a few post discussing using an innerJoin to do this but I'm not sure if that's the right path or not. Any help would be greatly appreciated.
You're looking for the filter filter. Here's how you might do it:
{% set entriesInCat = craft.entries.relatedTo(category).all() %}
{% set featuredEntriesInCat = entriesInCat|filter(entry =&gt; entry.yourLightswitchFieldHandle) %}
{% set remainder = entriesInCat|without(featuredEntriesInCat) %}

{% for item in featuredEntriesInCat %}
    &lt;h2&gt;{{ item.title }}&lt;/h2&gt;
{% endfor %}

&lt;hr&gt;

{% for item in remainder %}
    &lt;h2&gt;{{ item.title }}&lt;/h2&gt;
{% endfor %}