# [Sage 9] Taxonomy template

**URL:** https://discourse.roots.io/t/sage-9-taxonomy-template/18620
**Category:** sage
**Tags:** sage9, webpack
**Created:** 2020-07-06T18:11:56Z
**Posts:** 5

## Post 1 by @strarsis — 2020-07-06T18:11:56Z

A custom taxonomy has been defined for the WooCommerce product post type (not a product attribute taxonomy!).  
Now I try to add a template for this taxonomy to an existing Sage 9 theme, however, using the obvious path `resources/views/taxonomy-<taxonomy-slug>.blade.php` or `resources/views/tax-<taxonomy-slug>.blade.php` doesn’t work, the template is not used.  
How can I find out what paths would be loaded by Sage (9)?

Related: [Sage - Custom Taxonomy Template](https://discourse.roots.io/t/sage-custom-taxonomy-template/8847)

---

## Post 2 by @alwaysblank — 2020-07-06T18:17:24Z

IIRC the Sage 9 template loading logic is this: [https://github.com/roots/sage/blob/f3e794a09374d2f110742d15b9b975490fcddbee/app/filters.php#L46-L67](https://github.com/roots/sage/blob/f3e794a09374d2f110742d15b9b975490fcddbee/app/filters.php#L46-L67)

---

## Post 3 by @strarsis — 2020-07-06T19:02:13Z

Where can I find out what `collect` and `reduce` are exactly doing with the body classes?  
Are they filtered or compared to another array or the existence of template files?

---

## Post 4 by @alwaysblank — 2020-07-06T19:05:17Z

[`collect()`](https://laravel.com/docs/7.x/collections#creating-collections)  
[`reduce()`](https://laravel.com/docs/7.x/collections#method-reduce)

I’m not certain I understand your question.

---

## Post 5 by @strarsis — 2020-07-06T19:32:19Z

Ah, I understand. This has nothing to do with the actual template name or path, it collects the data to be passed to view by different filters.

So in Sage 9 the original/normal WordPress template name/path mechanism is used?  
Maybe a debug plugin could show me the template search paths for that taxonomy.

Edit: A debug plugin (Query Monitor or Debug Bar) indeed shows on each page/post/taxonomy all the template paths WordPress looks for.
