1

I have a content type "Product" with 2 taxonomies attached - "Brands" and "Product Types".

Brands:
  - Brand 1
  - Brand 2
  - Brand 3

Product Types:
  - Glasses
  - Sunglasses
  - Contact Lenses
  - Accessories

So in db i have nodes like (Node title, Product Type, Brand):

"Node1", "Glasses", "Brand 1"
"Node2", "Glasses", "Brand 2"
"Node3", "Sunglasses", "Brand 1"
"Node4", "Sunglasses", "Brand 2"
"Node5", "Sunglasses", "Brand 3"
"Node6", "Contact Lenses", "Brand 3"
and so on

On some page about glasses I need to create a list of all brands with glasses in db. With previous example data it will be "Brand 1" and "Brand 2". For contact lenses page it will be only "Brand 3", but for sunglasses page it will be "Brand 1", "Brand 2", "Brand 3".

I tried to create a taxonomy "Brands" terms view with added relationship "Content using field_product_types", set the filter with "Product Type" = "Glasses", but got no results.

Also tried to create content view of "Product" nodes with filters by "Product Types" and "Brands", but couldn't enable aggregation by Brands field.

Summary: how to list only those terms from taxonomy which has associated content of one specific term of another taxonomy?

Is there any way to do it with views or some module?

My Drupal core is 8.1.1.

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.