I have a nested taxonomy as follows:

taxonomy example

Some forms will only have the taxonomy of "Basic Forms", some will have taxonomy of "overtime forms", etc. So I want my Forms view to look like this example:


How can I get my view to recognize my nested taxonomy?

EDIT TO ADD: I have made some progress and what I have is repeating the parent taxonomy:

enter image description here

Forms_IT is the parent term-I'd like to start at the next one but can't seem to figure that part out either.

General & Quincy are on the same level. OT Approval is a subcategory to General but it is not appearing as such and it is repeating the parent and child taxonomy when it lists out the nodes.

This is how I want it: enter image description here

Any ideas on this? Is it simply a sorting issue?

7/25 - Edited again to add a pic of my setup and group by.

enter image description here

**enter image description here**

1 Answer 1

  • Create a list of all nodes that you want in your Views,
  • add the field for their taxonomy terms to show where they belong,
  • add the Parent relatinship for your taxonomy reference field to your Views. You may need to first add the relationship to the taxonomy reference field first, to get the Parent one to show as an option, in which case you'll en up with two relationships, the second one set to use the first one.
  • Add the Taxonomy Name field and set it to use the Parent Relationship. This field will show the parent term of the one the node is tagged with
  • Under Format use the "Group by field" option and set the first one to the Parent Field, and the second "Group by field" to the (sub-term) regular taxonomy field.

This should get you fairly close, I can't predict OTOMH where the nodes that have been tagged with only the parent taxonomy.

  • Thank you so much. SInce I made some headway, I edited my original post. I did basically what you said, and as you say, you couldn't predict how it would display tagged as parent. It is kind of repeating. I wish I could leave off the parent taxonomy (Forms_IT) but tried to do that for awhile and couldn't get that either. Please read my edits and see if you can offer any ideas. Thanks again.
    – KZeeh
    Commented Jul 23, 2019 at 23:45
  • apparently there was a similar question awhile back (drupal.stackexchange.com/questions/268386/…) and @kwadz ran into this same problem. I tried to comment there to see if this person ever resolved but I don't have enough points to comment. None of the modules suggested have a working version in 8 as far as I can tell either....
    – KZeeh
    Commented Jul 24, 2019 at 14:17
  • You've changed the question with your edit, you only had 2 levels in taxonomy originally, the edit is showing 3 levels. This means you have to add another Relationship for the grandparent level. The same logic applies. You haven't shown your field and grouping configuration. I think you may need to modify the query manually, sorting has nothing to do with structuring hierarchy so it won't help.
    – prkos
    Commented Jul 24, 2019 at 17:14
  • Thank you so much. Yes, I decided to paste in my actual example instead of my pseudo-example. I indeed did have the 3rd level. I have now added the images so you can see my field and grouping configuration. Thank you for taking a look.
    – KZeeh
    Commented Jul 25, 2019 at 16:24
  • Your Views is of the "Taxonomy term" type, while my answer focuses on the "Content" type Views. Maybe your approach is even easier to solve with the term views. But you have too many levels added, the first level isn't Parent, it's the lowest term field and you don't need a Relationship for it. Grouping is then done with Parent 2, Parent 1, and Term fields.
    – prkos
    Commented Jul 25, 2019 at 20:48

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.