Hi!

My problem is related to select nodes, using a view, based on hierarchical taxonomy.

I've created a node to record "things" related with a geographic location. Therefore, I've created a hierarchical taxonomy like this:

- Global
-- North America
--- Canada
--- US
--- Mexico
-- South America
--- Brasil
etc.

The problem is defining a "thing" as "US" (using CCK), when I filter at the view for "North America", the "thing" don't return on the report. Only if I filter for "US".

Any thoughts and comments are very welcome!

Thanks in advance!

Comments

matkeane’s picture

Hi,

I'm doing something very similar with a hierarchical geographic taxonomy using Views arguments. The View is configured to receive an argument for the region to be displayed using 'Taxonomy: Term ID (with depth)' with, in my case, the depth set to 1, so that nodes tagged with a country will show up when a continent is selected, but nodes tagged with a smaller region (such as a county) won't - which limits the numbers retrieved nicely. If you want all the child nodes to show, you can increase the depth accordingly.

One other thing, under 'Validator options' I've set the 'Argument type' to 'Term name/synonym converted to Term ID' so that, when combined with pathauto, I can use links like '/geo/europe/' or 'geo/france' instead of a numerical TID.

matkeane’s picture

Eduardo was kind enough to add an account for me on his test site, which made it easier to get to the bottom of this. The short version is that the site was using the Content Taxonomy module, which handles data in a different way to the core Taxonomy module (but offers a nice heirarchical pulldown menu), and so the normal Views filters for Taxonomy don't work.

Anyway, I found this post - http://drupal.org/node/520520#comment-2405878 - where nielsdefeyter mentions that there is an option for the Content Taxonomy field to also save term data into the core Taxonomy database table, as well as in a CCK field. This allows the Views filter to see the Taxonomy data - otherwise, Views can't see the Content Taxonomy data and so the filter returns nothing.

With the 'Save values additionally to the core taxonomy system (into the 'term_node' table).' option activated for the relevant field on the content type, and after resaving the nodes in order to get the term data into the core taxonomy table, the Views taxonomy filter was able to work. After changing the depth on the Views taxonomy filter, the Views results now show all nodes tagged with the currently selected region, and its child terms.