0

I used the Taxonomy View Depth module to create a taxonomy vocabulary like this.

Animal

  • Cats
    • Brown
    • white
  • Dogs
    • Brown
    • White

What I did was enabling the default taxonomy view, and changing the depth in Content: Has taxonomy term ID (with depth) to 1 instead of 0 (also tried 2,3, etc.)

The children items will never show on the page. It does remove the There is currently no content classified with this term. from the page.

What I want? With Taxonomy menu I want to be able to click Cats and show the second level children.

2 Answers 2

1

I used View tree Module to achieve this same kind of functionality but i used it for Node Reference. As per their module page, this module is also compatible for taxonomy.

Here are the steps to set Views Tree to display hierarchical taxonomy.

Create a new term view using the fields row style

  1. add relationship for taxonomy term: parent term
  2. add field term id (do not use relationship) and exclude it from display
  3. add field term id with relationship, exclude from display
  4. add any fields you want to display, like term name, term description, etc...
  5. Change style plugin to Tree (Adjacency model)
  6. Set Main field to Term ID
  7. Set Parent field to Term ID with parent relationship
1
  • Will try this when i get home from work. Will let you know. Thank you. Commented Feb 16, 2015 at 14:40
0

If using Drupal 7, views I has changed a lot from the year the question was asked.

In the view,

Filter criteria: Add

Content: Has taxonomy terms (with depth) (exposed) exposed is used when you are using BEF settings and want the visitor be able to modify the exposed filter.

Select the taxonomy vocabulary: like Animal from question.

Important step Selection type: Dropdown if autocomplete is selected show hierarchy wont show as a option. Drop down gives a option to choose the checkbox for show hierarchy

Depth: This option depends on the maximum child items you want to choose for a term as asked in question cats and dogs has child terms with depth 1, means if you want to see the content tagged to brown when you select cats term depth: 1 is prefered. If the child terms also have child terms then we need to increase the depth. For example if

Animals -cats --brown ---lightbrown --black

As Child term brown has lightbrown as child term, and if you prefer to show the content tagged to lightbrown if cats were selected then depth: 2 is recommended.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.