Filter by more than one tag in a Vocab

oldmanpants - May 1, 2007 - 01:04
Project:Taxonomy Filter
Version:5.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

Is it possible to filter by more than one tag in a vocab? E.g. if I am filtering vocab A by vocab B, and vocab B is set to multi-select.

Say vocab A is titled 'people', and vocab B is titled 'personal preferences', and I want to select 'women' from vocab A and 'likes choclate', and 'likes sex' from vocab B. This would require an URL something like: /taxonomy/term/23,156,157/all.

Possible?

Thanks.

#1

styro - May 1, 2007 - 04:26

Thanks for the feature request. Currently that isn't possible in taxonomy_filter.

I've long thought about how to add more than two terms to the filtering, but so far two main things (apart from time hehe) have stopped me going any further.

The first is how to actually design an user interface for this - ie how to go about removing a term from the filtering terms, as well determining whether clicking a link is adding an extra term or switching the filtering to that term etc etc. The closest interface I thought of mimicing was the (cool but geeky) del.icio.us interface with +/! symbols to add/remove terms. I have a nagging feeling though that it would make the interface less intuitive for non-technical users.

eg: http://del.icio.us/stython/drupal%2Bphp%2Bperformance

The second is that the whole module is starting to get quite complex internally with its growing options and functionality, and I'm getting a little worried about adding more to it without making it too hard to maintain or too slow.

I'm not ruling out adding this kind of stuff, but I'm still searching for a good way to implement it. I'd be keen to hear if you have any ideas for how the interface could work or even see some mockups if you've thought it through that far.

Cheers
Anton

#2

oldmanpants - May 1, 2007 - 10:15

Thanks for the reply.

The user interface I have been imagining, is one where taxonomy_filter lists multiple Vocabs in its block. E.g. Location, Cost, Genres, etc. The user is able to browse by first selecting an item from the master Vocab, which would trigger the taxonomy_filter block to appear, and then the use can refine the visible content by adding a set of Tags to the filter URL. It would be possible to select multiple Tags from any of the Vocab terms that are visible.

Here is an idea:

Once a (filter) Tag is selected, the original link to that Tag changes to a bold and non-selectable state. This would provide an quick visual reference to which Tags are selected. This is already implemented in most of your view options, but may also be useful in the tag-cloud view.

This may be too far from your original design idea, but the 'Only topics tagged with' section could become the 'Remove the following Tags from the filter' section. Any selected (filter) Tag would appear in the list. And clicking on it would remove it from the current filter URL, in effect broadening the scope of the view. In this sense the functionality would be like the navigation for the del.icio.us site.

I'd be interested to hear what you think.

Cheers.

#3

storbaek - July 27, 2007 - 07:16

Hi Styro

Thanks for your reply in http://drupal.org/node/140440, and we are also looking for a possibibility to filter several terms. However, as content is centered on the main pages together with the terms, we believe it to more intuitive for the users to do the filtering from the page AND not from the block!

This leads to two main functionalities:
1) Term filtering (or narrowing down the number of pages): Activated by pressing one or more terms on the main pages. When pressing the first term, this should trigger a block to show.

2) Term de-filtering (to broaden or increase the nummber of shown pages): Triggered by removing terms (filters) from the block. When removing the last term from the block, this should trigger the block to disappear.

Nice features, but not essential, would be url support, term highlighting etc.

We hope to see this functionality developed for the drupal one day, as it could help to build on the taxonomy being one of drupal core strengths.

#4

styro - July 27, 2007 - 23:22

However, as content is centered on the main pages together with the terms, we believe it to more intuitive for the users to do the filtering from the page AND not from the block!

Do you mean a) being able to filter when viewing a node? Or do you mean b) not having the filter menu in a sidebar but above the taxonomy listing?

a) seems a little illogical to me. If you're viewing a node you've narrowed down the possibilities as far as they can go - what is left to filter? Clicking a term will take you back to a listing where you can start filtering again.

b) this is really just a theming issue if I understand you. You can put the block in a region above or below the page content and using theme overrides and/or CSS get it displaying in a more horizontal listing like the standard $terms does. Or alternatively you could call the taxonomy_filter functions from within a theme template, or possibly override $terms to show it on a node (bearing in mind (a) above). You want to use the basic flat taxonomy_filter menu or the tag cloud for this I think - hierarchy is much harder to show in a horizontal list.

Note: back in version 1 of this module when it only supported flat non hierarchical vocabs it would adjust its rendering between horizontal and vertical lists depending on which region it was placed in. eg it would be a vertical list when on the sidebars and a horizontal list when in the header/footer/content regions. But adding hierarchical vocabs to the mix made this too complex and confusing to try and support.

This leads to two main functionalities:
1) Term filtering (or narrowing down the number of pages): Activated by pressing one or more terms on the main pages. When pressing the first term, this should trigger a block to show.

2) Term de-filtering (to broaden or increase the nummber of shown pages): Triggered by removing terms (filters) from the block. When removing the last term from the block, this should trigger the block to disappear.

How would you envisage blocks appearing and disappearing? Via ajax/javascript or would the page reload and somehow keep track of which terms are and aren't selected?

Also exactly what effect does having terms selected or not have in the context of the rest of the site? ie on pages that aren't taxonomy listings. eg what effect would changing filter settings have on say a node page?

It sounds like it could be well beyond the scope of the taxonomy_filter module. If you boil it right down taxonomy_filter exists purely to allow visitors to go from the basic /taxonomy/term/x urls (that the standard Drupal UI provides) to the more advanced /taxonomy/term/x,y urls (that Drupal doesn't provide any visible UI for out of the box) without having to know about and type those more advanced urls in themselves. The module doesn't actually do any filtering itself - that is all handled by the standard taxonomy module. This module only provides the menu that allows the user to select from a bunch of relevant /taxonomy/term/x,y urls.

#5

mstearne - April 10, 2008 - 02:26

There is an example of this functionality on ebay motors:

http://tinyurl.com/5dsrnw

#6

styro - April 10, 2008 - 05:12
Status:active» won't fix

I'm going to close this issue as it is getting beyond the scope of taxonomy_filter.

You guys should check out http://drupal.org/project/faceted_search instead for exactly this kind of functionality.

 
 

Drupal is a registered trademark of Dries Buytaert.