I don't know what the status of this is, but I'd like to help out with the port of the Taxonomy Handler to Views 2.

Comments

merlinofchaos’s picture

Work has not yet started on this. You're welcome to give it a shot.

RoboPhred’s picture

Status: Active » Needs work
StatusFileSize
new3.77 KB

I got taxonomy support working.

I made it as a separate module as it was simpler for me than trying to integrate it into existing files, but I suspect it would be fairly easy to bring into the core node view file.

Keep in mind this the first functional php script I have ever made that is worth talking about, and I do not know any of the good/safe coding practices for it.

I tested it with hierarchy and tagging modes, seems to work fine.
It supports field, argument, and filter.

I would like to figure out how to get argument to accept a name of a term, rather than the tid as it does now.
Also, I looked for a way to allow it to be sorted, but I do not think it is possible without being able to 'join' multiple tables to the query (I think I would need to join term_data to term_node, and join that result to the main table).

I still need to get the filter form to show a text box if tagging mode for the vocabulary (easy enough), and have the drop down box show the tags in a tree level for child terms (still need to fiddle with this).

jdc32’s picture

How can i install/patch this *.inc file?

Great job by the way, for me is the taxonomy feature the best and important feature of views.

RoboPhred’s picture

This is not a true patch, but a new module.

Create the folder "Views taxonomy" in the modules directory.
Create the file "views_taxonomy.info" in this folder, and set its contents to

name = Views Taxonomy
description = Exposes taxonomy options to views module.
package = Views
dependencies[] = views
core = 6.x

Create the file "views_taxonomy.module" in the folder and set its contents to

<?php
function views_taxonomy_init() {
  if (module_exists('views')) {
    module_load_include('inc', 'views_taxonomy', 'views_taxonomy');
  }
}

Then copy the .inc file to the folder. Note that I had to name the file .inc.txt for the upload, so you need to rename it after downloading it.

I am hesitant to start on an actual patch since I really don't know much about php, and know nothing about its security concerns. I would be grateful if someone who knew their stuff could look through the file and make sure there are no flaws in it, or even port it to a patch.

merlinofchaos’s picture

Hmm. creating the file taxonomy.views.inc in views modules folder should make it automatically be picked up (and that's how all core modules will be supported). This shouldn't need ot be a new module at all

neclimdul’s picture

StatusFileSize
new8.78 KB

I broke, fixed and added things. Its an update but it still needs work. There is also a huge nasty bug.

RoboPhred’s picture

Can you give me more information on what the bug is? I will try my hand at working on it.

drewish’s picture

StatusFileSize
new8.64 KB

here's an updated that earl rolled for me on irc

neclimdul’s picture

StatusFileSize
new10.91 KB

shoot, didn't know drewish posted a patch. earl and i hashed some more stuff out but... i don't have anything in drewish's patch merged in. It's late so I'm just posting what i've got. It works for joining on fields.

The term grabing should ideally be moved to some pre_query magic but one step at a time.

RoboPhred’s picture

None of the patches support arguments, although it is a quick and easy add.

The argument handler I had in my first attempt (and is included but unused in the latter patches) is not actually needed, since my first patch was using taxonomy ids as the arg, not names.

I do not know which of the recent patches I should expand on, but to get arguments to work you just need to add

    'argument' => array(
      'handler' => 'views_handler_argument',
    ),

to the "All terms" entry.
Also, delete the "views_handler_taxonomy" class, as it is not used.

drewish’s picture

RoboPhred, #9 is the most up-to-date, feel free to roll a new patch.

merlinofchaos’s picture

Assigned: bennybobw » Unassigned

The assignment's a little misleading =)

himerus’s picture

Any word on when this is going to be included?

I need taxonomy support for filters prior to being able to launch a site I'm working on, as it's a core component in 3 major views that are used on the site.

Thanks! Each new version is looking better and better!

merlinofchaos’s picture

Status: Needs work » Fixed

I've committed a significantly enhanced version of this. Taxonomy isn't done yet -- notably I haven't done much work on arguments -- but there's a good start in there. We'll mark this fixed and open new issues as they arise.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.