Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Showing with A OR B tags from taxonomy

Started by davidburb 7 years ago · 7 replies · 566 views
7 years ago

Hi there,

Just a simple one here. In my frontmatter, I would like to create a collection using that pulls in anything tagged with "oranges" OR "apples". When defined as below, it only brings in things tagged with BOTH "oranges" AND "apples". Is there a simple way to define the collection such that any post tagged with either of the tags is in the collection?

YAML
title: 'Oranges & Apples'
content:
    items:
        '@taxonomy.tag':
            - oranges
            - apples
    order:
        by: date
        dir: desc
    limit: 5
    pagination: true
7 years ago

I'm afraid this doesn't help me. It lists pages tagged only with foo AND bar. Not foo OR bar (or both)

7 years ago

Oh, I can't believe I had overlooked that! Thanks for your help.

7 years ago

And an update in case if anybody else wants to do the same thing - I tried this as @Perlkonig said and it worked perfectly. Thanks for the help!

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 16 hours ago
1 46 9 hours ago
Support · by gtx, 1 week ago
4 227 2 days ago
Support · by Paul Hodges, 2 weeks ago
13 277 5 days ago
Support · by Anna, 3 weeks ago
9 334 1 week ago
Support · by TomW, 2 weeks ago
4 188 2 weeks ago