Taxonomy Manager - Status Update

mh86's picture

After finishing my exams last week, I finally had much more time to work on my project this week as the last time.

So I started with coding. The first task was to write a simple jQuery script for a dynamic tree view (collapsible parents) for a vocabulary.
After that I integrated the script into my module and set up a form page to display a hierarchical tree. The form includes checkboxes and weight forms for every term. A theme functions transforms the form with terms into the list structure I need for the dynamic tree view. Concerning the browser compatibility, I still have to do some testing. In future a own taxonomy tree element type might be useful, because others maybe interested in a basic tree-form too.
Additional the page contains and an extra fieldset with multiple textfields for adding new terms.

The form already supports deleting of selected terms, updating of weights and adding of terms (optional to one ore more parents as child terms). Many details, like a confirmation form for deletion or validations are still missing.

If you are interested in seeing some code of the taxonomy manager module, I committed it to my project cvs directory.

To sum up, a list of functionality, that's in progress at the moment or already have been done:

  • dynamic tree view for hierarchical vocabularies in combination with forms
  • deleting of selected terms
  • updating of weights
  • adding of terms

My plan for the next days:

  • testing for browser compatibility and some optimizations
  • adding of basic functionality like moving of terms in hierarchies or merging of terms
  • confirmation form for deleting of terms
  • validations
Groups:
Login or register to post comments

demo site pls

benc's picture
benc - Mon, 2007-07-09 07:14

Hi Matthias,

Kindly put a demo site up, if you can, so we could try it out quickly (and we can get others to try it out too). Or make screenshots available. Thanks for the updates!

"Work smarter, not harder."
http://digitalsolutions.ph


demo site

mh86's picture
mh86 - Mon, 2007-07-09 07:58

hi!

here my demo site. Feel free to try out everything (deleting,...), it's only test data :)


Very nice! One question: what happens to legacy links?

mlncn's picture
mlncn - Thu, 2007-07-12 11:08

That's mighty fine, Matthias!

One thing that I'm trying to do in community-managed taxonomy (CMT) is have a "merge onto" as well as a "merge into" to allow the term you're merging to be primary (name, location)... of course, since you have the entire taxonomy laid out, the user can just select the other way around in the first place... so never mind, now I don't wonder why you haven't thought in that direction.

We're pursuing pretty different UIs so I'm not going to be able to steal nearly as much as I'd hoped! ;-)

One thing we both will want to deal with:

What happens to the links to the merged terms?

If term 12 is merged into term 34, we don't want the link http://example.com/taxonomy/term/12 to stop working– we want it to go to, or act the same as, http://example.com/taxonomy/term/34

I was thinking of a solution that required CMT to do custom handling of the vocabularies it manages (or a total hack like path aliases, which could actually work quite well), but since this will be a more general problem maybe there's a moderately clean way to handle legacy terms that we can get into core taxonomy.module

~ ben melançon

member, Agaric Design Collective
http://AgaricDesign.com - "Open Source Web Development"


Maintain history of how terms merge

maui1 - Thu, 2007-07-12 11:41

A potentially useful feature here might be to retain a history of all merged terms, and which terms they were merged with. This might be used several ways, one might be a new kind of tag cloud that showed merged terms, with size reflecting the number of terms that were merged into a particular term, another might be to raise the option for someone entering a taxonomy term on a post to see which of the terms he is using and how they have been merged into new ones.


good suggestion!

benc's picture
benc - Fri, 2007-07-13 06:00

If this could be done, i'll appreciate it very much. A simple list of what was merged and the results is okay for me.

"Work smarter, not harder."
http://digitalsolutions.ph


Merging terms thoughts

mlncn's picture
mlncn - Mon, 2007-07-16 03:02

Hi Matthias,

Sorry my brain was a bit slow working.

My term merge table does what we need, it's based simply on core taxonomy's related terms table.

Mine isn't of use to you because it is meant for votes to be counted against (rather than meant to reflect actually merged terms).

But simply a table of term1 and term2 just like the related terms table will do for a merge history.

This works because we're never going to be deleting term IDs even when they have no independent existence.

If we follow the convention of having term1 always be the primary term, the term that term2 is being merged into, we even have that information.

Also that way only the primary term has to be searched to get all terms merged into it (albeit it does have to be searched recursively).

And I can push out information to this table, and we could both use it to handle links to previously existing terms.

It would be good to try to get this in core.


Good progress!

benc's picture
benc - Mon, 2007-07-09 09:09

Matthias, I got excited with the demo you provided :)

I tried merging and i appreciated the options that you included for the merge.

I have some comments and questions, below. Feel free to say whether they are doable within the sked and scope of your proposal.

  1. The dropdown boxes for controlling weight are too far from the corresponding terms. Can you later present the terms in table format, with alternating row colors?

(Much much later (perhaps beyond SoC), we can hopefully merge what you have done with Konstantin's drag-drop functionality. Or probably something as simple as Moodle's way of reordering lists, using an Up arrow and a Down arrow.)

  1. I successfully merged 2 & 4, but i got this error:

* user warning: Duplicate entry '122-0' for key 1 query: UPDATE term_hierarchy SET tid = 122 WHERE tid = 106 in /usr/export/www/vhosts/funnetwork/hosting/hias2205/includes/database.mysql.inc on line 172.
* user warning: Duplicate entry '122-0' for key 1 query: UPDATE term_hierarchy SET tid = 122 WHERE tid = 108 in /usr/export/www/vhosts/funnetwork/hosting/hias2205/includes/database.mysql.inc on line 172.

"Work smarter, not harder."
http://digitalsolutions.ph


thanks for testing

mh86's picture
mh86 - Mon, 2007-07-09 14:44

thanks for testing and your report :)

I agree, that the actual solution with the weight forms isn't optimal. First I thought I add the 'odd' and 'even' classes to the lines (for alternating line colors), like drupal does in tables, but this is a little bit tricky with collapsible list, because you can not determine what color a following item should have, because it depends on whether the item above is expanded or not. So it could happen, that two following lines get the same color....

I like the idea of up and down arrows. Concerning a drag-and-drop functionality, I rather like to implement the more important features first.


JQuery Interface sortable module

bonobo's picture
bonobo - Mon, 2007-07-09 15:34

RE:

we can hopefully merge what you have done with Konstantin's drag-drop functionality. Or probably something as simple as Moodle's way of reordering lists, using an Up arrow and a Down arrow.

Take a look at the interface_sortable module -- it might get you there pretty quickly.

Cheers,

Bill


FunnyMonkey
Tools for Teachers