Drupal select lists by default put hyphens into select lists as a crude way of showing taxonomy hierarchy. For example:

Africa
-Southern Africa
--Angola
--Botswana
-Western Africa
--Ghana
Europe
-Eastern Europe
--Albania

etc...

This breaks Chosen, because chosen selects based on word start, and treats the hyphens as word start (so it fails to match "Ango" with "Angola" because it treats the word as "--Angola").

Also, it looks awful.

You should replace the hyphens with  , spaces or a combination, so that this module works with taxonomies that have a hierarchy.

CommentFileSizeAuthor
#3 chosen-search.png24.93 KBshadcn

Comments

Taxoman’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Priority: Normal » Major
Taxoman’s picture

"chosen works fine with entity reference module when referring to taxonomy with muliple levels. It's a node title field name issue between field node title and taxonomy title."

#1368992: Chosen doesn't drop down with term reference field and taxonomy on nodes

shadcn’s picture

Status: Active » Closed (works as designed)
StatusFileSize
new24.93 KB

You need to enable "Search also in the middle of words" on the config page.

Chosen search

playfulwolf’s picture

I kind of disagree with that - it should work even without this option

gtothab’s picture

What is the path to this setting? All I see in the Chosen settings is the selector box and a "minimum number of options"....

Thx

gtothab’s picture

Nevermind, I found the settings. I did't have the dev version installed and those appear only on the dev version. HOWEVER, now my select list does not get the Chosen applied to it at all.

I have the 'apply chosen to this field' option selected from the field options and also have it listed in the Chosen configuration page.

This is a Taxonomy select list.

This appears to be my problem: http://drupal.org/node/1960370#comment-7259704

d_f’s picture

If it's been designed to work like this, can it also be adjusted to save the term lineage as well?

d_f’s picture

Issue summary: View changes

fixed formatting

batigolix’s picture

You can find this option via:
Home > Administration > Configuration > User interface > Chosen
(admin/config/user-interface/chosen)

druplicate’s picture

In my case I don't want to search in the middle of words.

I have a large taxonomy of numbers (4,000 terms) where I want to search from the beginning only so I don't get results like this:

If I want to search for 2.7...

I don't want: 5242.755, 236552.7, 12.78, and zillions too many more.

I do want to get results like: 2.7, 2.70, 2.765, etc.

Removing the dashes isn't easy (see this: http://drupal.stackexchange.com/questions/85011/how-to-get-rid-of-the-si...) but it's important I think.

The Taxonomy Container module improves the look but does not remove the dashes. This probably should be fixed in Drupal core (taxonomy module). I'd vote for moving that module's code into core and getting rid of the dashes altogether.