Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By slayerment on
Is it possible to order the multilist selection field by alphabetical order when you are creating a new flexinode?
For instace, could i have my HTML form that is structured like this:
value, name
1, dog
2, cat
3, pig
4, horse
5, turtle
6, hamster
be ordered like:
value, name
2, cat
1, dog
6, hamster
4, horse
3, pig
5, turtle
Any help would be awesome. Thank you.
Comments
Anybody?
Anybody?
modules/flexinode/contrib/field_multiselect.inc
I changed the code in modules/flexinode/contrib/field_multiselect.inc to the following:
This alphabatizes the multiselect field when content is added. However, it doesn't alphabatize the options when you're editing the content type itself via "content types".
Note: if the field isn't "required" then "<none>" may sink in the list if you've got options that begin with numeric values.