Views2 exposed filter: hierarchical taxonomy
For a school website, my 'year group' taxonomy is structured like this:
Vocab: yeargroup
Terms:
primary <----- parent term (not a vocabulary)
- Y3
- Y4
- Y5
- Y6
secondary <------ parent term
- Y7
- Y8
- Y9
- Y10
- Y11
- Y12
- Y13
If a teacher tags a node with 'primary', the intention is that the node is for all four Y3-Y6 year groups.
Similarly, nodes tagged with 'secondary' are intended for all seven of those year groups.
I am trying to set-up a view, whereby pupils can use an 'exposed filter' to list all nodes which have been tagged for their year group; I've got this working. The next part isn't working...
If the user sets this exposed taxonomy-filter to 'primary', I would like it if all blog posts tagged with primary, Y3, Y4, Y5, or Y6 were listed. I think this is probably called something like 'a hierarchical taxonomy selection' or 'recursive taxonomy'?
Instead, what happens at the moment is that the parent/child relationship is completely ignored; 'primary' is just like any of the other terms. It is as though the structure is 'flat', which it obviously isn't.
Any information or ideas would be welcome.

Sorry, got to bump this. Is
Sorry, got to bump this.
Is my description understandable?
_
I did this using hierarchical_select (which has an option for storing all the parents in the hierarchy). I've also seen reference to using the http://drupal.org/project/taxonomy_multi module, but i've not had a chance to try it yet.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thanks for your reply. You
Thanks for your reply. You seem to be confirming that, although you can visually make
a hierarchical taxonomy structure, it can't actually used? Actually, I remember reading that
the internal core list at /taxonomy/[N]/all will select all children of parent term [N].
Can't views utilise that in the same way? Will I definitely need a dedicated module?
Regarding HS, it only seems to have a 'quick D6 port' from August, doesn't it?
And the D5 version is on RC7 at the moment - that probably indicates lots of problems?
Also, I didn't know it worked with views?
Is this really the best solution?
_
From what I could see, according to merlin, 'not yet'. (See http://drupal.org/node/258774).
hs does integrate with views exposed filters, so yes they work together, though i haven't played with it much past what i needed for my site. So far, i haven't had any problems.
Another option i stumbled across: http://drupal.org/project/lineage
You're probably just going to have to try them out and see which works best.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thanks for your continued
Thanks for your continued input.
I don't like the feeling of trying to make hierarchical taxonomy work if drupal wasn't really built for it.
Can you think of alternative workarounds?
I don't know which direction to take, because I don't know what Views2 can do.
For instance, would it help if I rearranged the taxonomy like this:
Vocab: Primary
Terms: Y3, Y4, Y5, Y6
Vocab: Secondary
Terms: Y7, Y8, Y9, Y10
Could I then have two exposed filters?
One filter to choose the vocab, and another to choose the terms?
But then, what would be the consequence of choosing 'primary' in the first and 'Y8' in the second?
Would I still get all the 'Y8' nodes returned, or are the filters 'accumulative'?
Perhaps it would be better to have one flat vocab:
year groups: primary, secondary, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Y10
... if I could then make a filter which allowed queries like 'primary + Y7'
ie. list all nodes which have been tagged for all 'primary' years, plus nodes which have been marked as Y7 only
Any ideas?
I can be quite flexible with the taxonomy.
The most important thing is that the pupils can find all nodes intended for them.
Thanks.
_
Personally, I think you have the taxonomy ordered correctly. It's just a quirk of drupal that the relationship is a little difficult to get to. IMO you shouldn't organize the taxonomy sub-optimally to overcome a quirk. But that's just me, the choice is, obviously, yours.
fwiw though, i don't think you can get exposed filters to behave the way you describe by reorganizing the taxonomy. They're simply additive.
As i said, I created exactly this with hierarchical_select and it works quite well. If i had to choose another method, i would probably opt to try out taxonomy_multi or one of the taxonomy navigator modules like tinytax.
Sorry-- that's probably not what you wanted, but i don't see how else to do it.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
> Sorry-- that's probably
> Sorry-- that's probably not what you wanted, but i don't see how else to do it
Don't worry... you've saved me ten hours of pulling my hair out trying to find out if Views2 could do it or not, wondering whether it was just my incompetence.
I'm still also reluctant to go with a taxonomy module; I'll try them out though, at least.
But I think I'm just going try to keep it all as simple as possible. If it comes down to it, the teachers are just going to have to 'multi-tag' the node with all appropriate year groups, as individual terms rather than one 'blanket', parent term.
Or maybe I can use the default taxonomy/N/all pages in addition to a view for the individual year groups.
Thanks.