Taxonomies by section

I’ve been doing a bunch of reading but not quite sure I fully understand what I’m trying to accomplish. An example is probably best.

Say I had a site, where I wanted to split products up by different types. In my case I’ve accomplished this with structures instead of with categories as it seemed to be a cleaner way of doing it.

So I’ve got

/content/refrigerators/
/content/freezers/

In my case, I’ve got black refrigerators and white refrigerators but also black freezers and black refrigerators. Also different door types, etc… the list goes on.

So with default taxonomies. If I add doors to the config file, by default hugo will display “Black” for both of these different sections.

What I want is for the user browsing in refrigerators to be able to filter their search back only on black doors, for refrigerators only.

One way I “think” I can accomplish this is by creating multiple taxonomies for this purpose. So “refrigerator doors” and “freezer doors” and then utilizing custom templates per content directory to only show the ones I want. It kind of seems messy I guess. But I’d create a layout specifically for /content/refrigerators/_list.md and only show the taxonomies I want there…

Does this sound right? Did I miss something? Or a better way to go about this? Any other thoughts?

Thanks as always, this forum has always been a huge help… and I rarely actually have to post a question.

As a user I want to see to all freezers that are white, where the doors pivot on the left side, where the width is 80 cm or less, with a four-star rating or higher, that have an ice cube maker.

If I have 2 product types, 2 colors, 2 door options, 2 widths, 5 ratings, and 2 ice cube maker options, that’s 2 x 2 x 2 x 2 x 5 x 2 = 160 possible combinations. Which means you would need 160 layouts.

And that excludes the sorting options (by price, by rating, etc.).

Yes, it does.

I’d use a dynamic CMS (Drupal, WordPress, etc.) for something like this. If you are intent on using Hugo, I would not use taxonomies. Instead, I would dynamically filter the list pages using JavaScript.

content
└── products
    ├── product-1.md
    ├── product-2.md
    └── product-3.md

content/products/product-1.md

+++
title = "Product 1"
date = 2020-12-06T19:57:16-05:00
draft = false
type = "freezer"
color = "white"
door = "left"
width = 75
rating = 4
ice_maker = true
price = 753.09
+++

Then with JavaScript you would essentially be doing a SQL query, along the lines of:

SELECT * FROM products 
WHERE type='freezer' AND color='white' AND door='left' AND width<=80 AND rating>=4 AND ice_maker=true ORDER BY price DESC

thanks for your reply… under normal circumstances, I’d agree that a user might want to see everything but in my specific circumstance, that’s not going to be the case. The refrigerator/freezer example was indeed just an example. Truthfully we’re talking about just a few “filters” so to speak… If this wasn’t online I’d divulge the specifics but rest assured, the customer will not want to see what would be filtered from product one to

So if we have 3 major product “categories” which in our example would be a freezer or a refrigerator… then we have a specific type of freezer or refrigerator (for a specific commercial purpose) then we get to some other specifics that break down some other not features but “attributes” … In this rare case, it’s not functional (and would probably be annoying) for the user to see the attributes across the categories and types.

Hope I explained that right.

I do like the dynamic filtering … Javascript is my weak point though…

What’s your question?

I guess aside from the original taxonomy layout, I don’t have one. Was just clarifying the situation