Currently, this is NEARLY doing what I want except instead of the output being entries that do NOT have the id, it's output is ONLY the entries with the id. I'm not sure why, since I've included the 'not' keyword within the parameter.

{% set entries = 
craft.entries.section('driverPositions').limit(null).relatedTo('not' , 7192) %}

{% for entry in entries.order('state, city').limit(null) %}

<option value="{{entry.url}}">{{ entry.state }} - {{ entry.city }}</option>

{% endfor %}

thanks in advance!


You can get the entry IDs that have are related to the category and then exclude them from the all the entries.

{% set entryIdsWithCategory = 
craft.entries.section('driverPositions').relatedTo('7192').limit(null).ids() %}

{% set entryIdsWithoutCategory = craft.entries.section('driverPositions').limit(null).ids()|without(entryIdsWithCategory) %}

{% set entries = craft.entries.section('businesses').limit(null).id(entryIdsWithoutCategory).order('state, city') %}

{% for entry in entries %}
    <option value="{{entry.url}}">{{ entry.state }} - {{ entry.city }}</option>
{% endfor %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.