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

How to I loop through taxonomy using OR instead of AND in Twig?

Started by Muut Archive 10 years ago · 1 replies · 353 views
10 years ago

Hi, simple question.

{% for feature in taxonomy.findTaxonomy({'category':['News','Links'] })and.order('date', 'desc').slice(0, 4) %}

The above Twig loops and find articles in my blog tagged with News and Links but I want to find all articles tagged with either News or Links

10 years ago

Actually findTaxonomy takes an optional second param (and | or), defaults to and.

TWIG

{% for feature in taxonomy.findTaxonomy({'category':['News','Links'] }, 'or') %}
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1369 9 years ago
Archive · by Muut Archive, 9 years ago
2 942 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago