Reputation: 13
Having trouble getting setcontent to work as expected with Taxonomies.
I'm in a record template and want to pull in other items that share any of the same taxonomy values. So I don't want to hardcode the values in, but instead compare to my current record.
For example, here's a hardcoded query, checking for items that have 'Apps' in their topics taxonomy.
{% setcontent relinterviews = 'interviews' where { topics: 'Apps' } %}
Instead I need something like this pseudo code, but that works:
{% setcontent relinterviews = 'interviews' where { topics in record.taxonomy.topics } %}
Ideally, I want to be pulling in items that match two different taxonomies - Topics and Roles - but I'd settle for one.
Upvotes: 0
Views: 307
Reputation: 826
Try these:
{% setcontent relinterviews = 'interviews' where { topics: 'Apps || Other' } %}
{% setcontent relinterviews = 'interviews' where { topics: 'Apps', roles: 'MyRole' } %}
Upvotes: 1