[drupal-devel] [feature] Make taxonomy selection widget themable

robertDouglass drupal-devel at drupal.org
Mon Sep 12 13:58:47 UTC 2005


Issue status update for 
http://drupal.org/node/30993
Post a follow up: 
http://drupal.org/project/comments/add/30993

 Project:      Drupal
 Version:      cvs
 Component:    taxonomy.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  robertDouglass
 Reported by:  robertDouglass
 Updated by:   robertDouglass
 Status:       patch (code needs review)
 Attachment:   http://drupal.org/files/issues/taxonomy.txt (4.32 KB)

The taxonomy select widget becomes unmanagable very quickly. If there
are more than two levels in a hierarchy or more than X number of terms,
it is almost impossible to use. This patch makes it a themable element
so that creative UI designers can start cooking up better solutions.
Here are the changes, in detail:



* There is a new function theme_taxonomy_term_select which is a carbon
copy of the old _taxonomy_term_select, plus XDoclet comments.
* The old _taxonomy_term_select function calls the theme function using
the theme() syntax.
* taxonomy_form  has an extra parameter $title = NULL so that the label
on the form can be set by the public API. When NULL it defaults to the
vocabulary name as usual. The reason I need this and I think Drupal
needs this is that taxonomy is really useful for lists of items that
need to be reused. Take the list {good, bad, ugly}. This set of terms
could describe lots of things, defying any attempt to give the
vocabulary a catchall name. Now, with the updated taxonomy_form, I can
create a form element called 'Rate my code' and get the abovementioned
list. In the same form I could have another element called 'George Bush
is' and use the same list over again.
* taxonomy_form now has XDoclet comments.



robertDouglass




More information about the drupal-devel mailing list