Struggling to get multiple relationship filtering working. So want to filter an entry (people) by one or more of the following: - location (entries) - specialism (categories) - team (categories)
For example, if I have any entries that are related to location X, specialism Y and team Z then show them but when trying to use relatedTo with the and parameter I am getting zero results, whether that is in twig or at element API level. I have tried both passing in element ids and objects but with no success, so eg:
{% set relatedTo = [ 'and', [ field: team', targetElement: teamCategories ], [ field: location', targetElement: locationEntries ], ] %} Then:
{% set entries = craft.entries({ section: 'people' }).relatedTo(relatedTo) %} But always seems to return zero results when I know there are matching relationships in the CMS.
Any thoughts?