Hello

I am using module Select (or other) and I want to know if there is possible to chnage position of button other. I want this button always on top (i.e. always first in a list).

Thank you for answers.

Comments

kejmil’s picture

Priority: Normal » Major
VM’s picture

Assigned: kejmil » Unassigned
Priority: Major » Normal

Note: The assigned* status of an issue is only to be used if you are providing a patch or otherwise fixing an issue. for more information on how to set the status fields in issues see: https://www.drupal.org/node/156119

legolasbo’s picture

Version: 7.x-2.2 » 7.x-3.x-dev

New features are developed against 7.x-3.x.

legolasbo’s picture

Status: Active » Closed (won't fix)

I think adding this option would add complexity to an already complex settings form. It is also very easy to implement this by implementing hook_preprocess_HOOK as demonstrated below.

/**
 * Implements hook_preprocess_HOOK().
 */
function testing_preprocess_select_or_other(&$variables) {
  $original_options = $variables['element']['select']['#options'];
  $options = array('select_or_other' => $variables['element']['select']['#options']['select_or_other']);
  unset($original_options['select_or_other']);
  $options += $original_options;
  $variables['element']['select']['#options'] = $options;
}
markusd1984’s picture

Component: CCK / Field API widget » Field widget (non-specific or listed)

I understand it may be complex to add but given that the main purposes of the module is to provide an "other" option and the whole thing being a list i'd say it's likely many people will also use the Add 'Other' value to the list of choices for this field. which likely results a long list growing quickly and this the "other" options disappearing in the noise.

Therefore I think having a setting to keep it easily reachable and visually noticeable is really important, in fact perhaps one needs to use some css to visually highlight and differentiate it. Perhaps a another way would be to provide "other" or "Create new values" via a button next to the list could be more obvious but also even more complex of course. :)

Therefore one can only make the label very long and descriptive in efforts to try differentiate it visually from all the existing values in the list.

Thanks for the hook, that worked a treat, just applies it to all Other lists of course, an individual setting would allow to choose when or when not to use it, e.g. in small list or where it's not likely i would keep it disabled but on long list especially where usually new titles are being created than enabled.