Skip to content

An example Tag for Statamic 3 that explores using the Entries Query Builder to query Taxonomy Terms using AND and OR logic.

Notifications You must be signed in to change notification settings

martyf/statamic-taxonomy-and-or-logic

Repository files navigation

Demo of AND and OR logic when working with Taxonomies in Statamic 3

Statamic 3.0+

Sometimes you need greater flexibility and control when filtering a collection based on a taxonomy (or even multiple taxonomies).

Within your own tag, it is easy to build your own query using Statamic's EntryQueryBuilder that can perform different query logic (AND or OR) on your taxonomies to determine whether your filters become stricter (AND) or broader (OR).

For more information, check out my filtering entries by Taxonomy in Statamic 3 using AND or OR logic.

Run the demo

If you're reading this, you're probably already in the Statamic and/or Laravel way of thinking, so this should be straight forward.

  1. Clone the repo, and configure your server as you normally would
  2. Create and configure your .env as necessary
  3. Run composer install
  4. Run npm install
  5. Build the assets with npm run production
  6. If you want to log in to the Control Panel, make yourself a user with php please make:user

License

This addon is licensed under the MIT license.

About

An example Tag for Statamic 3 that explores using the Entries Query Builder to query Taxonomy Terms using AND and OR logic.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages