Hi all,
for my Portal I absolutely need a way to filter data on terms and node types.
I have several node types (7, at the moment, which are extensions of the standard story module), and some of them share the same vocabulary.
As an example, I created a 'Geography' vocabulary, which represents a tree with all the Italian regions and Italian major cities.
In my portal, which will deal with choral music, this vocabulary is linked to events, choirs and resources.
Another vocabulary (genre) is linked to choirs, events, weblinks.

This takes me to the point where I need to extend taxonomy in order to be able to do this:

?q=taxonomy/page/or/143,145/choir,events

to filter out or to feed only choirs and events dealing with terms 143 and 145 (which are 'pop' and 'jazz' music type)

For this reason I hacked taxonomy module and taxonomy_html module in order to add this functionality.

After the list of terms, you can specify a list of comma separated node types, and it works fine. It works also with feed.

Before going on with the tests, I would like to know if someone else is working on the same functionality, in order to avoid duplicate work.

Furthermore, I would like to use a 'standard' Drupal, so I would not like to have an 'hacked' functionality on a 'core' module like this.

Since I think this feature could extend tremendously Drupal possibilities (I'm really in love with Drupal...), I would like your opinion on this matter.
I'm also available to send you the code by mail; unfortunately it is not published yet.

Matteo
webmaster@cantincoro.org

Comments

This is a feature available on slashdot - allowing the user to select which "sections" appear on their version of the front page. In my case I have a single "Topic" vocabulary with 47 terns, and would like users to be able to determine which terms should appear on the front page, since they're not likely to be interested in all 47.

It would also be nice to be able to assign an image to a taxonomy like they do on slashdot.

the polder theme allows for associating an image with taxo term just like slashdot

i can see how this feature would be useful. the url format you propose isn't really 'clean', but I can't think of anything better. I suggest you send a patch to the devel mailing list

I agree with you... but I could not find anything better.
Any suggestions will be appreciated.
This week, after some other tests, I'll release the module.

Matteo
mailto:webmaster@cantincoro.org

Matteo

I thought about this some more, and I think the right approach is actually an uglier URL, not cleaner. Oh well. Here's what I propose

We use an URL like taxonomy/or/2,3&nodefilter=and/event,story

I want to use this nodefilter parameter on the tracker page, the archive page, and eventually more places. Filtering by node type is useful. The reason we should use the &filter= URL syntax instead of a more clean URL is that the position of the arg() for tracker and taxonomy and archive are going to be different it makes for cleaner code to always expect the nfilter to be its own querystring param. This is how the pager links work ... I hope this made sense.

Since it is not so clear to me the difference between 'clean URL' and other urls, could you help me in writing the code to parse the URL ??

Matteo
mailto:webmaster@cantincoro.org

Matteo

Hi all,
I followed yuor suggestions and ported to Drupal CVS, implementing node filtering according to your proposal.

You can find the module in:

http://cvs.drupal.org/viewcvs/contributions/sandbox/matteo/modules/Drupa...

I would like to know what to do in order to update CVS.

P.S: taxonomy.module should be upgraded to manage node filtering...

Matteo
mailto:webmaster@cantincoro.org

Matteo

Hi, I like your module much then dhtml module.I just install CVS versin in my drupal 4.3.2.
I would like to show this in my page:
texas (5)
- houston (2)
- austin (3)

But I could not found count nodes in page,just how like this:
texas
- houston
- austin

How can I add count nodes ?

Thank you much.

It is very strange.....
nodes are already counted; I'm using Drupal CVS (but the logic is not changed since 4.3.2). It prints out counts for nodes.
Which theme are you using ?? I'm using xtemplate and it prints out node counts correctly...
Please let me have more details, and I'll try to figure out what's going on..

Matteo
mailto:webmaster@cantincoro.org

Matteo

Yes,I use a modified xtemplate and have 3 columns.I just add a "headlink" function to xtemplate.I modified the xtemplate.theme and xtemplate.xtmpl.

In xtemplate.theme,I add following to "function header":

   if ($headerlinks = $this->links(link_page())) {
   $this->template->assign("headerlinks",$headerlinks);
   }

and in xtemplate.xtmpl, add following:
    <td  class="headerlinks">
    headerlinkshere
    </td>
  </tr>

and I also modify the xtemplate.ccs, I don't know whether will cause the problem, because I found the dhtml module also missing nodes count.

Thank you for your reply.

Mathew, yuor post is truncated; I oculd not read it all...
I'm using XTEMPLATE too, and I don't see anything strange in your logic that should change module behaviour.
By looking at the source of the generated page, are the count missing also there ???
In some themes I could not see the numbers because of CSS values.

If you can send to me your theme, I can check it on my installation...
Consider that now I'm using Drupal CVS, not 4.2...
Sorry, I can't do more...

Matteo
mailto:webmaster@cantincoro.org

P.S.

Matteo

Hi all,
I released a modified version of taxonomy.module that adds support for node type filtering.
Code can be enhanced, but it's working on my test site.
I also created an enhanced version of taxonomy_htm.module that uses the new taxonomy feature.

The new taxonomy_html module also change behaviour of the module:

if you have a tree like this:

texas (5)
- houston (2)
- austin (3)

the total (5) is the sum of houston+austin (no nodes are linked to texas); if you click over texas, taxonomy_html shows only texas nodes, so an empty list is shown.

What I did is to modify taxonomy_html.module to show, when you click over texas, all the nodes belonging to texas+austin+houston, so a list of five nodes is shown.

This is very useful if you have a tree like this, where some terms are used only as a 'container'.

I hope I could explain the concept.

Download the code from here

Comments, feedbacks etc are well accepted...

Matteo
mailto:webmaster@cantincoro.org

Matteo

fyi, the blocks outoputted by taxonomy_dhtml already count nodes as you describe. i guess taxonomy_html never got updated accordingly.

Yes, you're right, but taxonomy_dhtml is really heavier if you have many nodes because requires reading at least name attribute.
Actually I have 710 choirs mapped through 4 different vocabularies with more than 300 terms, but with taxonomy_html page is rendered in less than 1 second. The same with taxonomy_dhtml takes about 3 seconds....
If noone takes care of that module, I can do it !!! It is the main feature that made me choose Drupal !!

Matteo
mailto:webmaster@cantincoro.org

Matteo

Hi Matteo,

I installed these two new modules, and get this error in the navigation column .
warning: Missing argument 2 for taxonomy_html_vocab_vert() in /hsphere/local/home/complian/umhscompliance.org/modules/taxonomy_html.module on line 62.

thanks,

Ellen

Hi all,
fro those of you interested, I updated taxonomy_html and taxonomy modules in order to filter on one or more node types.
These modules work on Drupla CVS.

Yuo can find them in my sandbox.

Matteo
mailto:webmaster@cantincoro.org

Matteo