Taxonomy Manager Update

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
mh86's picture

This week I got some feedback for the first parts of the taxonomy manager. People provided me with additional ideas, that's always great. Again I thought about some points, like how to manage term weights or how to do merging.

Weight Management:

Concerning the managing of term weights, I initially planed to place weight form fields (selects) on the right side for each term. This allows you the mass editing of weights, but has some disadvantages, because the weight forms are too far away from the term itself and it's hard to get the right weight field for the right term.
One idea was to implement an drag and drop feature instead, what might be the best for reordering and changing of weights, but I think this would take too much time to implement and there are still more important things to do.
Another idea was to add up and down arrows. This is in my opinion a very nice way of changing the weights and simpler (as drag and drop) to implement. I plan to add two buttons with up and down (or four with additional „to top“ and „to bottom“) and every term, that is selected, gets reordered (by swapping of weights with the predecessor/successor or by in-/decreasing the weight). The updating should be done with AJAX, so that a total reload of the whole page isn't necessary.

Merging:

First I want to explain what merging actually does.
The aim of merging terms is to put terms with the same meaning together, e.g. it often happens that people write abbreviations and others not for the same word into the autocomplete field. For example we have tags like „Summer of Code“, „SoC“ and „GSoC“, which all have the same meaning (they are synonyms), but are saved as different terms. So what merging does, is to build one main term, where all other terms, with the same meaning are added as synonyms and afterwards deleted.Term - Node relations are automatically updated, optionally it's possible to choose for hierarchical vocabularies to add children, parents and/or relations of merging terms to the main term.

Benjamin (Community Managed Taxonomies) pointed out, that this may have unwanted side effects, because links to merged terms no longer exists. We still have to find a solution. There were some suggestions from the community to set up an additional table, where we store, what has been merged.

Concerning the merging it might be helpful of setting up a separated merging API, because both, Benjamin and I will use it.

Performance:

The aim of the Taxonomy Manager is to make it easier to work with vocabularies, especially bigger vocabularies. At the moment, I build the whole taxonomy tree form and do the rendering of the form array when the page gets loaded. This works fine for smaller and middle sized taxonomies (up to 500 terms), but with an increasing number of terms, it gets very very slow and the browser may hang up. That's of course not very fine, because there are vocabularies much more bigger, especially folksonomies (this are vocabularies with no hierarchies) tend to get huge.

Concerning hierarchical vocabularies, I plan to load only the first level terms for the first page load and to reload the nested children terms through AHAH when they are needed (when a parent term gets expanded).
For folksonomies it might be good to load just some parts from beginning (e.g. 200 terms) and to implement a kind of pager or a alphabetic index.

Upcoming Work:

Major points for upcoming week:

  • Adding of „Up“ and „Down“ arrows for changing of weights
  • Working on performance improvements (AHAH reload,..)

Here again the demo site :)

Comments

Changing Parent

nicholasThompson's picture

How are you handling/planning on handling changing the parent?

changing of parents

mh86's picture

there is button called "move selected to..", which allows the changing of parents. For multiple hierarchies it's possible to add more parents at once (and optional old parents can be kept too).
Concerning the moving of children to the root level (removing of parents without deleting), this can be done again with "move selected to.." by leaving the autocomplete form for parents empty.

Merging terms and changing parent

mlncn's picture

I posted on the other thread but just to put here, the table for tracking merged terms can simply be:

term1
term2

where term1 is the term that got kept in that merge.

Changing a parent - moving a term - I think can just be done. No need for a history.

If the question is what to do with children terms if a parent is moved, Drupal core taxonomy has a standard that's analogous. When a term is deleted, children terms are deleted (so in our case moved) rather than orphaned unless it is a multiple hierarchy vocabulary and that term has other parents, in which case the term stays. Since we're only moving, not deleting, the extra parent connection can move along with us.

So actually we don't have to do anything about children nodes when moving the parent. When merging a parent we'll have to change the parent (term) ID of the child term to point to the term ID of the resulting merge.

benjamin, agaric

SoC 2007

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: