Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It would be great if the terms selection would reflect their hierarchy, for example let's say that I got a parent term (it's parent value = 0) named "US" and I got 3 other terms which are it's sons "Texas", "California" and "New York", I would like to see their display as something like:
US
- Texas
- California
- New York
Instead of the current display:
US
Texas
California
New York
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#11 | multiselect_show-hierarchy_446052.patch | 1.25 KB | AaronBauman |
Comments
Comment #1
attheshow CreditAttribution: attheshow commentedI'm not personally concerned with this, but please feel free to post a patch if you get it working yourself.
Comment #2
jdleonardI'd really like this functionality as well. I'll try to work on a patch in the next 2 weeks, but I don't have a lot of time. If I don't come up with anything by June 15, 2009, feel free to change the status. Also, if anyone else can come up with a patch, I'd be happy to test/debug it.
Comment #3
attheshow CreditAttribution: attheshow commentedComment #4
Francewhoa+1 for this feature
Comment #5
benone CreditAttribution: benone commentedIf hierarchical option cant be added, is it possble to order terms alphabetically ?
It could be faster to find term if hierachy would be enabled, but if not, alphabetic order is the 2 not bad possibility.
What do you think ?
B.
Comment #6
xjmI assume folks mean with the Content Taxonomy module. I need this feature as well. I will try to come up with a patch based on the option that the normal Content Taxonomy widget provides.
Comment #7
xjmHere's the bit that does this in the Content Taxonomy module:
Comment #8
xjmActually, it looks like all that needs to be done is to implement hook_widget_settings() and content taxonomy module takes care of this by itself! The problem so far is detecting whether the field is actually a content taxonomy field or not, as this information doesn't seem to be passed to the hook.
Comment #9
xjmI'm beginning to think this might be best patched in Content Taxonomy, not in Multiselect. Discussion open on g.d.o:
http://groups.drupal.org/node/57033
If you don't care about a meaningless settings fieldset showing up on your multiselect fields that aren't content taxonomy fields, you can patch
multiselect.module
to add the following function and the indentation will work just as it does for the normal Content Taxonomy select field:The terms will be out of order after moving them to or from the selected list, and so the hierarchy is only valid when the page first loads (see #417328: Sorting, #421938: Preserve selection order), but it seems to work.
Comment #10
attheshow CreditAttribution: attheshow commentedPlease don't reopen this issue unless posting a patch that needs review.
Comment #11
AaronBaumancomment #9 works for me.
here's the patch
Comment #12
xjmComment #13
davidseth CreditAttribution: davidseth commentedPatch at #11 works great. Please commit, thanks.
Comment #14
alexweber CreditAttribution: alexweber commentedThanks guys! Committed in e280324.