Required modules: Views, Pathauto, Simple hierarchical select, Taxonomy Views Integrator.
Create content type "food".
Create vocabulary "food" add some example terms:
+ fruits
- apples
- orranges
+ vegetables
- carrots
- potatoes
Pathauto settings
go to: admin/config/search/path/patterns
and set the taxonomy term paths:
pattern for all food paths -> [term:vocabulary]/[term:parents:join-path]/[term:name]
Thanks to this pattern our food paths will look like: food/fruits/apples
and may contain more than one parent, for example: food/parent1/parent2/parent3/child
Go to: admin/structure/taxonomy/food
and check if all paths are setted up correctly. If not, edit them and check Generate automatic URL alias
.
Views
Create view showing taxonomy terms from food
vocabulary and add these three displays:
Page: Title: "`All food content`"
Path: /food
Relatonship: Taxonomy term: Content using Food terms
.
Page: Title: `Food category`
Path: /food/%
Relatonship: Taxonomy term: Content using Food terms.
Contextual filter: (field_food_terms) Content: Has taxonomy term ID (with depth)
contextual filter settings: depth = 1
(use: this page override)
Override title: Food category - %1
This means, if we go to food/fruits
, all items one level below fruits
will be shown (all fruits)
Page: Title: `Food subcategory`
Path: /food/%
Relatonship: Taxonomy term: Content using Food terms.
Contextual filter: (field_food_terms) Content: Has taxonomy term ID (with depth)
contextual filter settings: depth = 0
(use: this page override)
Override title: Food subcategory - %1
There is no terms below, if we go to food/fruits/apples
, all items with term name apples
will be shown (only apples)
Use Views to override term paths
At the end you need to go back to: admin/structure/taxonomy/food
edit each term and choose Use view override.
For each term you need to specify which view will be used to override, it's the main disadvantage of this solution.

Results



An example of article and blocks with relationship to the taxonomy.
