I'm trying to get a list of entries of a certain section, however I'd like to exclude certain users that are defined within a field of the entry.
The users to exclude from the query are fetched like so:
{% set exclude_users = entry.winners_exclude %}
Now, what I'm trying to do is to exclude the users in theexclude_users
-array from being returned with the query results, something like the following (which does obviously not work, but you might get the idea of what I'm trying:
{% for entry in craft.entries.section('bildupload').author(not in exclude_users).search('challengeId:' ~ch.id).order('likecounter desc').limit(3).with(['useruploads']) %}
Specifically I'm talking about the .author(not in exclude_users)
part.
I didn't really find anything on the question if that is at all possible within the elementCriteriaModel query itself. It works with an additional if-condition within the for-loop, however since the elementCriteriaModel needs to be .limit
(ed) to 3 but needs to exclude some users, excluding them within the loop after limiting the result to the first 3 results obviously results not in what I want, since it will just exclude the users from the first 3 results.