Hi

I've tried to understand how a hierarchical taxonomy works. I thought that a selection/search of a parent term would also list the children? Let me exemplify:

I have a vocabulary named 'Subject'.

The Subject taxonomy hierarchy looks like this, (just a bit of it)

1. Cardiology (url: taxonomy/term/7)
1.1 Heart physiology (url:taxonomy/term/23)
1.2 Heart pathology (url:taxonomy/term/24)
1.2.1 Symptoms (url:taxonomy/term/28)

If I "tag" a book page with the Heart pathology tag, shouldn't this page be shown if I list all pages from the Cardiology category with the URL taxonomy/term/7 because Heart pathology is a child of Cardiology. Isn't this how it is supposed to work?

If not, what is the purpose of the hierarchical taxonomy?

Comments

cog.rusty’s picture

To display all categories under Cardiology you can use:

/taxonomy/term/7+23+24+... etc

or better

/taxonomy/term/7/2 which means "2 levels deep"

or even

/taxonomy/term/7/all

If these links look ugly, you can give them an alias using the "url aliases" option of the path module (included in core Drupal).

The + syntax is a boolean OR. There is also a syntax with commas (,) instead of pluses (+), for listing nodes common to many categories (boolean AND).

Boletus’s picture

Thanks for the answer. But I can't get it to work. The /taxonomy/term/7+23+24 of course works since it is basically a OR statement. But the /taxonomy/term/7/2 or /taxonomy/term/7/all does not show any child to Cardiology tagged content. What the h*ck am I doing wrong here? :)

Are you sure that /taxonomy/term/7/2 are supposed to show child tagged content to the parent category?

styro’s picture

Do you have the views module installed? Or any other contrib modules?

If you are using the views module for taxonomy listings, the depth parameter is handled differently and isn't part of the url.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

Boletus’s picture

Yes I have the views module installed. How does that influence the way the urls to taxonomy/term/7/2 is handled?

styro’s picture

Are you using the views module for taxonomy listings? This only applies if you are, if you haven't enabled a view for the /taxonomy/term/ url this doesn't apply.

To set the depth on the taxonomy listing view, you need to edit its "Taxonomy: Term ID" argument. That arguments "Option" field is the depth to use.

The views module version of the taxonomy/term listing doesn't use the standard taxonomy modules url argument for the depth - you need to change the view itself.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

phreestilr’s picture

This is exactly what I need, but I can't find the argument's "Option" field where you say you can put the depth to use. Am I just blind? Any help would be greatly appreciated! (I'm using Drupal 6 and Views 2)

phpepe’s picture

Just remove the current argument,
and add a new one called: "Taxonomy: Term ID (with depth)"
Then you can configure the taxonomy depth.
Regards.

cog.rusty’s picture

Yes, it should work if your vocabulary is a hierarchy and the "Heart pathology" term has "Cardiology" as parent.

Boletus’s picture

I can make a view that shows the Cardiology and 2 levels down. So, the hierarchy works. But, I cant get the taxonomy/term/7/2 link to work. It this a bug or feature so to speak? :)

cog.rusty’s picture

It works for me with the views module enabled. I am afraid we will never know. I should be able to reproduce this behavior to have an opinion that counts... :)

You said they are book pages. Do you also put these nodes in a similarly structured book outline??

Boletus’s picture

No, the book is not structured like the category tree. Why should it have to be?

I'll have to use the views module then. Not a big deal. It works. :) But I would like to know if this is a bug, or what it is with my setup and configuration that makes the taxonomy/term/7/2 and taxonomy/term/7/all URL:s useless.

Thanks for help guys and gals!

sepeck’s picture

check out
http://drupal.org/project/taxonomy_browser

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

petya_vulcheva’s picture

Hi

I want to make something like complicated taxonomy hierarchy :)

I need to make something like this: a category for county (etc england, spain, italy and so on), a category for topic (etc sport, fashion, lifestyle). And then when search the content for some of this terms and to display all the content tagged as the searched term. I looked for the most appropriate modules but I am pretty confused now. Can anyone tell me do I need some specific module for the taxonomy and if someone have done such thing more help will be very useful. Thanks very much!