Hi Merlin !

First, thanks very much for this module, it's simply brillant. Not only did you provide us with a very useful and nice way to browse content, but you also added a great administration interface. I can imagine that's a lot of work and I am thankful for the time you spent on this.

There is nevertheless a feature I am missing. I could try to implement it myself and provide a patch but I'd like to know beforehand if you have planned it on your TODO list or if you could just give me some hints on where to add it in the code and which way you would do it yourself if you had to. I would also like to know if this is something you might consider adding to the code.

On the site I am working on, they use vocabularies with hierarchy. The term hierarchy inside both the administration interface and the exposed filters interface is not reflected in any way. I can think of two different type of interface for this.

In the admin interface, hierarchies would simply be shown as in any other places in Drupal, using multiple levels of - for indents. Example:

- Sport
-- Tennis
-- Rugby

In the exposed filter interface, this way of representing the hierarchy is not very straightforward, although it's understandable. I would prefer to have maybe one select per level, changing the selection on the first select would change the options of the second level accordingly using javascript.

The problem is mainly that these kind of selects use javascript and it's not degradable, unless your javascript code changes the select itself on success. Ie you start with a standard select that uses -, then the javascript changes this select to multiple selects. If the javascript runs, it's fine. If it doesn't, you still have the ugly select.

This kind of trick can be used for book structures as well. My Drupal site is huge and they now have hundreds of book pages, it's a pain to add a page to a parent.

Anyway, I would like to know if you thought about how to deal with terms hierarchy and if you need a hand on that. I can help implement this feature and also the javascript selector trick.

My goal is to let the user be able to select Rugby under the Sport term and see the results of her selection. How to handle this both in the admin interface and in the view page.

Thanks in advance.

Bertrand Mansion
Mamasam

Comments

jjeff’s picture

I would love to see this system work for not only hierarchical vocabularies but for ALL modules that implement filters that Views can use... I've written an article with some of my thoughts here:

http://www.lullabot.com/articles/drill_down_system

-Jeff

yched’s picture

Maybe you're already aware of that, but the activeselect.module deals with pretty much the same things.
Might be a good starting point ?

merlinofchaos’s picture

It's worth noting that the gadget that Views puts up can very easily be overridden with a theme function and/or form_alter. Either way would be a very good way to do this.

Second, the function that fills the select boxes can also pretty easily be overridden. That means a module to do cool stuff to those gadgets is *very* easy to do I think. I'd love to see something along those lines.

merlinofchaos’s picture

I took a quick look at Jaza's activeselect module. Yes, it's exactly what is needed to implement this, I believe.

I think it would be best to create a new module that actually provides a new set of filters rather than using hook_form_alter. It'll be a lot easier to control what gets exposed, and the custom handlers can set everything up properly.

1) Create another set of filters, 1 per vocabulary, that use the activeselect type as the 'value' widget. Note in the help that this filter is meant to be exposed.

2) Actually create the infrastructure necessary in order to use the activeselect gadget.

3) Use the 'option' to control the depth -- since we're using multiple select boxes to do taxonomy hierarchy. In this case, it'll control how many gadgets we actually display.

4) Implement hook_form_alter because we'll need to add extra items to our form if it's using an active select widget.

5) We'll have to be careful with naming. Due to the way the system is implemented (there may be a better way but I couldn't see it while I was writing this) it actually looks directly at $_POST rather than processing the form; this is because the form is processed entirely too late for those values to do any good. I need to look into maybe moving that form earlier in the process.

merlinofchaos’s picture

Status: Active » Postponed

I will explore this after 1.0.

ore’s picture

Has this ever been persued? I am in need of this functionality and I'm going to start to do a hack for it unless its already been started somewhere as views is now 1.2

ore’s picture

I've managed to hack this functionality into the current views module but only using categorys at this stage and for my current application.

Its all hardcoded in at the moment but I think it would be easy to make a module as merlin has said.

All I have done is simply modify the function views_filters_form($view) and deal with each filter as its exposed. Once the first filter is select use a post back and then use that value to filter the categorys assigned as children to the selected in the post back. My application also has another set of categorys which act as another parent to the above child categorys so is a little more complicated in that I have to find all the nodes assigned to the child categorys which are also nodes of the 2nd parents before displaying in the second filter box.

I have a bit more work to do in limited selections to whats actually available in the db but once I've done that I'll try to write up what i've done and post back. Could be the start of another module or just a hack writeup.

reggie75’s picture

hi ore,

any code snippets would be of great help to novices like me :)

thanks,
reggie

orican’s picture

Hi,

any news?
i second code snippets would be very helpful...

bcn’s picture

tracking...

nicolash’s picture

subscribe

momper’s picture

subscribing

mr.andrey’s picture

Any updates on this? I would love to have this on my site. Thanks. A.

summit’s picture

Version: 6.x-2.x-dev » 5.x-1.6
Component: User interface » Code
Status: Postponed » Active

+1 to get this done.
Hierarchy in terms is for me now not to shown with views.
It would be great to be able to give the argument say "campings" and say from another vocabulary (regional) a taxonomy term.
And than have the view look at the camping and the taxonomy term as arguments and show all beneath subterm nodes also.
Thanks for replying!
greetings,
Martijn

summit’s picture

Status: Active » Fixed

Hi,

I solved this somewhat to use a filter on an taxonomy term and select a top-hierarchy term and state the value "3" in the option field. The "3" means that the top-term and 3 depth the terms will be shown.
The only problem with this solution is that per term I want to show I need to build a view.

Until now it is unpossible to use a argument for a filter? am I correct Earl?
If wanted, I would be happy to attach my build view here to show my solution.

Greetings,
Martijn

summit’s picture

Status: Fixed » Postponed

I changed it to fixed by accident. Sorry..

realityloop’s picture

Version: 5.x-1.6 » 6.x-3.x-dev
Status: Postponed » Active

I've not been able to find a way to do this, and think it may have gotten lost amongst other stuff due to Merlins statement of tackling it after 1.0.. so am updating status and Version.

feel free to change status again if I'm wrong.

merlinofchaos’s picture

Maybe hierarchical select module.

realityloop’s picture

Version: 6.x-3.x-dev » 5.x-1.6
Status: Active » Postponed

reverting back to previous status, have found how to do this with Views 6.x-3.x-dev

merlinofchaos’s picture

Status: Postponed » Closed (won't fix)

Since the D5 Views is never getting new features, may as well close this.