Ben
Ben

Reputation: 927

Create view in Drupal with a taxonomy argument that displays values for hierarchies

I'm trying to get my view to work correctly using a taxonomy argument. My taxonomy has a hierarchy so if I supply the main taxonomy term (which has various sub-terms), I want it to show results for the main term plus all the sub-terms. However, at the moment it is only supplying results for the main term and excludes it's sub-terms.

So, I have one term: "Project Management", then sub-terms: "Next Steps", "Fundraising", etc. When I show the view with the "Project Management" argument it doesn't list any items found with the "Next Steps" or "Fundraising" terms. It only shows the "Next Steps" items when that argument is explicitly given.

Ben

Upvotes: 1

Views: 4964

Answers (1)

semperos
semperos

Reputation: 4724

The taxonomy argument you need to use is Taxonomy: Term ID (with depth).

When you add that argument and look at its individual configuration window, towards the bottom you should see a small select drop-down titled "Depth". Set the depth of children terms you would like to include in results.

As an argument, enter any taxonomy term ID you know to have nodes tagged with its children terms, and you will see results including the argument and all children.

I'd forgotten the exact way to do this myself, but it's outlined on this site.

Upvotes: 2

Related Questions