- ivnish Kazakhstan
Automatically closed because Drupal 7 security and bugfix support has ended → as of 5 January 2025. If the issue verifiably applies → to later versions, please reopen with details and update the version.
Created a custom module so the Other option (select_or_other) is listed after the select/none item and before the existing options (from the other field values).
Making it easier to select 'Other' option (custom entries) being the first option underneath instead of listed above/ontop.
Also better then 'Other' as default since one gets used to selecting underneath in a list, where also existing values are listed.
Might be a better alternative to the " Other "button" always on top → " module.
Tested with 7.x-3.0-alpha3+1-dev using select list. Not tested with checkboxes/radio buttons or other version.
Anybody keen to test it and with other versions/widget? I'm happy to help and release it as a module thereafter.
Note: In my screenshots you can see the optional checkbox to add the other value to the list ✨ Make "add value to list" a choice for end-user (only for reuse) Closed: outdated that I also created and think is better in some cases then making it default for all fields (to avoid unnecessary values that won't be reused) as one has to make a conscious decision if a custom value is required and whether it should be added or not. .
Real life example:
select_or_other_between_selectandoptions.info
name = Select or other between select and options
description = <b>Other option (select_or_other) is listed after the select/none item and before the options(other field values).</b><br>Making it easier to select 'Other' (custom entries) being the first option underneath instead of listed above/ontop.<br>Also better then 'Other' as default since one gets used to selecting underneath where also existing values are listed.
package = Custom
core = 7.x
version = "7.x"
select_or_other_between_selectandoptions.module
<?php
/**
* Implements hook_preprocess_HOOK().
*/
function select_or_other_between_selectandoptions_preprocess_select_or_other(&$variables) {
$original_options = $variables['element']['select']['#options'];
$select_removed = array('' => array_shift($original_options));
$select_or_other_removed['select_or_other'] = array_pop($original_options);
$variables['element']['select']['#options'] = $select_removed + $select_or_other_removed + $original_options;
}
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended → as of 5 January 2025. If the issue verifiably applies → to later versions, please reopen with details and update the version.