[drupal-devel] [feature] Testers needed: Node Type filtering in taxonomy on Drupal 4.5

Steven drupal-devel at drupal.org
Mon Jan 24 17:24:11 UTC 2005

 Project:      Drupal
 Version:      cvs
 Component:    taxonomy.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  matteo
 Reported by:  matteo
 Updated by:   Steven
 Status:       patch

This could be hard to implement as $foo is a multi-var path. e.g.
"taxonomy/terms/1" "taxonomy/terms/1/1" "taxonomy/terms/1/0/feed" etc.


Previous comments:

October 25, 2004 - 22:20 : matteo

Attachment: http://drupal.org/files/issues/taxonomy_nodetype_filter.patch (5.46 KB)

The attached fix wants to add a new feature to taxonomy.module: the
ability to filter data also on node types.

This is a need when you have to share one vocabulary between multiple
node types.
One example is the vocabulary 'Geography', containing all Cities and
Regions. You could have events, stories and other custom made node
types, sharing this vocabulary.
The need arises when you want to see only events of a certain region;
if you filter only on region, you'll see also stories and the other
custom node types.

The new syntax is the following:


to filter based on three terms (in OR each others) and on two different
node types



to filter based on three terms (in AND each others) and on two
different node types

The rest of the syntax for taxonomy/term remains the same, and the
patch works also for taxonomy feed.

Node types are tested for validity. You can specify one or more node
types; if you omit node types, normal term filtering is issued.

Feedbacks and help testing this patch is needed; personally, I think
this would improve temendously taxonomy functionalities, and hope this
will be committed to Drupal core.

Feel free to contact me by mail:  m dot ferrari at tiscali dot it



October 25, 2004 - 22:25 : moshe weitzman

see http://drupal.org/node/5040


October 25, 2004 - 22:46 : matteo

I agree with you that this is an old story, but nothing has been
committed to 4.5, that introduced also a new taxonomy syntax.

My patch has also some pluses:
- it is specific for 4.5 and takes care of the new taxonomy syntax
- it lets you specify multiple node types
- syntax is clean



January 19, 2005 - 23:05 : robclay

Will this work with 4.5.2?

If so - I am looking for exactly this funcionality!


January 20, 2005 - 06:43 : matteo

I'll work on a port for 4.5.2 hopefully next week...
I'll keep you informed.


January 24, 2005 - 00:19 : matteo

Attachment: http://drupal.org/files/issues/taxonomy_nodetype_452.patch (4.43 KB)

Here is the patch that adds nodetype filtering capabilities to 4.5.2
taxonomy module.
Syntax is backwards compatible, so if you plan not to use node type
filtering, syntax does not change at all.
 (see previous postings in this thread)

I would need extensive testing and feedback... and hope this
functionality will be included into Drupal core.



January 24, 2005 - 00:38 : Steven

New features only get added to the HEAD branch... you'll have to update
your patch.


January 24, 2005 - 07:56 : matteo

Ok, Steven,
I'll rewrite the patch also for CVS....



January 24, 2005 - 10:16 : matteo

Attachment: http://drupal.org/files/issues/taxonomy_nodetype_CVS.patch (4.05 KB)

Here is the patch for Drupal CVS.
I noticed the great addition of node_rewrite_sql... very powerful...
I'm starting extensive testing on the patch, and I really woul like it
to be added to core taxonomy, because it becomes a must for several


January 24, 2005 - 15:43 : moshe weitzman

I'd rather see this done universally (not just for taxonomy urls) using
the new sql rewrite capability. specifically, some code will implement
the rewrite_sql hook and look for a querystring param &ntype=blog,story
and then inject the proper WHERE clause. this will be very useful for
tracker, home page, taxonomy urls, etc.


January 24, 2005 - 16:59 : Dries

Before looking at the code (which violates Drupal's coding style), what
do people think about the proposed URL scheme?

Can anyone tell me why we use 'taxonomy/term/$foo' and not just

How about we change that to:

 taxonomy/all/$foo (or taxonomy/$foo)

... instead of the proposed URL scheme?  It looks slightly more
readable to me.

(Does anyone know what 'synonyms' are for, and whether they could solve
this problem?  Really, I have no idea what these are for, even after
having read the documentation.)


January 24, 2005 - 17:15 : jvandyk

Synonyms are useful for things like organisms, which have both a common
name and a scientific name. That's the idea of synonyms, not
necessarily the Drupal implementation of synonyms, which we plan to use
but are not yet using.


January 24, 2005 - 17:57 : Steven

Can anyone tell me why we use 'taxonomy/term/$foo' and not just

I believe this is because when the URL changes were discussed, there
was talk of a 'taxonomy/vocabulary' page which would display an
overview of a vocabulary. But I think that role has already been filled
by a contributions module.


January 24, 2005 - 18:05 : Prometheus6



retrieves all node types then I think


is the cleanest looking way to be specific. Give it a fixed position
because it will always be there whereas the node type may or may not

View: http://drupal.org/node/12114
Edit: http://drupal.org/project/comments/add/12114

More information about the drupal-devel mailing list