I have a node with a 1 to 1 entity reference to a custom entity. The the custom entity has a hierarchical taxonomy (Regions). I need to filter the nodes with a specific parent term of the regions.
e.g:
Node -> Custom Entity -> Term reference: Region
Region Vocabular:
Germany
- Munich
- Hamburg
- Berlin
Austria
- Innsbruck
- Vienna
I want to get a filter where I can select "Austria" for example and then get all nodes which have a child of Austria on the referenced entity.
I added the custom entity with a relationship and also the term. But I get only the filter "Content: Has taxonomy terms (with depth)" which is not working as the term is not on the node it is on the entity.
Why is the " Content: Has taxonomy terms (with depth)" only working with nodes? Is there another solution / filter I can use to filter the nodes?
Comments
Comment #1
marcusx commentedCome on no answer? This should be documented somewhere. :-) I learned it the hard way.
I tried to solve this by writing a custom views filter handler and was nearly finished as I figured out that the reason why we can't lookup the terms of an entity so easy is the missing taxonomy_index table in core for other entities than nodes. #1040786: Include entities in taxonomy_index
But there is a module for that: Taxonomy Entity Index
https://drupal.org/project/taxonomy_entity_index
Thanks to Dave Reid views integration is already there! I wish I would have known this earlier. My lesson learned for this week.
Comment #2
xtazThanks for your post marcusx.
Taxonomy Entity Index module resolve my issue with Taxonomy exposed filter with depth on unpublished nodes.