Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
30 Jun 2006 at 22:16 UTC
Updated:
7 Sep 2006 at 03:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
skcombs commentedI rewrote the code, so I don't need help with that. But I am wondering what the comment about Views Arguments means when I select Taxonomy Term ID as it pertains to categories:
"This will display one of the taxonomy terms associated with the node; if taxonomy terms were used to filter or sort, it will be the one that triggered the sort or filter."
It seems that when I pass an argument that is a term with children and grandchildren, not all of the terms get printed as taxonomy headers. And I have specified the depth option. The terms that do get printed as headers are those categories that have child categories. Are these the only terms that "trigger" a filter? And if so, how can I display the leaf terms?
I have attached the exported view for comment.
Comment #2
merlinofchaos commentedI think the problem here is that when you use the depth option to filter on a hierarchy, the 'term' field that you see will always be a 'close' one to the node, i.e, one that is 0 terms away, regardless of what term actually triggered the filter. (the filter is an OR on essentially two different fields).
Soooo, to do what you want to do requires a field Views doesn't have yet, which is 'parent term of the current term'. Worse, how that field gets populated would almost certainly be...very very confusing, unfortunately, because the context can change dramatically from view to view.
If this were added (you can experiment, if you like, by editing views_taxonomy.inc; you could add a clone of the term_data table, with the left side of the join linking to term_hierarchy.parent and the right side linking to tid. Have that table export the 'taxonomy: term' field, but call it taxonomy: term parent.
Once you've got that, *then* in your theming function, you'd have to compare which of the two terms match the filter, and use *that* as the header field. You'll need to try and not put items from the same hierarchy in the trigger as they could both match and that'll confuse the code.
So, ah. Welcome to the wonderful world of Views + hierarchical data. The whole thing is a mess, which is why after all this time, taxonomy is the one area that Views still has a few issues.
Comment #3
merlinofchaos commented