I have a homepage single section has a field for entries (only 1 can be selected). This field is called featuredEntry.
In my homepage template (index.html) I set a variable {% set featured = entry.featuredEntry %}
for the field
I then loop thru that to pull in that entries content {% for mainEntry in featured %}
I have a listing of entries below it that pull from the same News channel as the featured entry above. I don't want the featured entry to show in that list.
I followed the answer here (Exclude "featured" entries from a "recent" entries {% for %} loop) with slight changes to try and omit that entry.
However, setting a variable {% set featuredIds = featured.ids() %}
for the above featured entry doesn't seem to work.
I am omitting additional entries that are marked with a certain tag as explained here: List entries without specific tag
What am I missing here or what is wrong for my code to not pull in that id of the featured entry?
{% set featuredIds = featured.ids() %}
{% set mainTag = craft.tags.search('All-Stars').first() %}
{% set allEntries = craft.entries.section('news') %}
{% set taggedEntries = craft.entries.section('news').relatedTo(mainTag).ids %}
{% set omitIds = 'and, not ' ~ taggedEntries|join(', not ') ~ allEntries|join(', not featuredIds') %}
{% set untaggedEntries = craft.entries.section('news').id(omitIds) %}
{% for feedItems in untaggedEntries.limit(5) %}
In that code above in the omitIds variable, if I do this:
{% set omitIds = 'and, not ' ~ taggedEntries|join(', not ') ~ allEntries|join(', not SPECIFIC ID') %}
It works.
Thanks in advance.