I am trying to create a View to display related content based on shared taxonomy terms from multiple vocabularies.
For example:
I have two content types called Car and Parts.
I have two vocabularies called Type and Country.
Content Types:
Car
- Entity Reference: Type
- Entity Reference: Country
Parts
- Entity Reference: Type
- Entity Reference: Country
Vocabularies
- Type: sedan, convertible, coupe, van, suv
- Country: usa, japan, germany
I would like to display a view of related Parts when viewing a Car node. Furthermore, I only want to display if both Type and Country match.
I’m able to get either Type or Country matches to display by adding the following relationships.
- Content: Taxonomy terms on node
- (term) Entity Reference: Referencing entity (type)
- (term) Entity Reference: Referencing entity (country)
and a contextual filter of:
- (Content referencing Taxonomy term from field_country) Content: Nid
Basically, switching the relationship on the contextual filter determines whether or not Type or Country matches should be displayed. I am having trouble figuring out how to display Parts that match both the Type and Country of the Car.