What we are trying to do:
I am using three category-groups, "product category", brands and country of origin, to create a navigation in a shop with the ability to filter the content of each product category with a specific brand or country.
The product category group is used to generate the main navigation and when a category is selected a listing-page is displayed with the entries of that category.
The display page in turn shows a "sub-nav" of the different brands and countries of origins.
Structure of the product category group:
Main category 1
sub-category 1
sub-category 2
Main category 2
sub-category 3
When i pick a sub-category my url looks like this:
domain.com/products/[sub-category]
This page should show all products in this category and possible 3rd levels of product groups in the top and then brands and countries in a sub-nav.
It should look a little like this:
3rd lvl sub-category
-
Brands
Brand 2
Brand 5
Countries of origin
Country 1
Country 3
Where Brand 1/3/4 and Country 2 are not shown since no product with the [sub-category] has them selected.
When i select a brand or country that segment is added to the url and {segment_category_ids} gives me all the matched categories for use in the {exp:channel:entries} tag.
This is where i am having some problems..
I cant get my head around how to display only the brands and countries that have entries in the already selected [sub-category].
By default it displays every category that is used by any entry in the products channel. We haven't used categories all that much so i am not sure that i am going at it the right way.
I have tried to create a list of all the entry_id's from the subset and use those pipe-separated in the show-parameter of the {exp:channel:categories} tag-pair but i haven't gotten it to work yet.
We have mostly been using Playa for relations between different entries and "pages" before but i thought i could be good to get a grip on how to do it natively.
Does anyone have a better approach or any ideas on what i should do?