Hello,

your module really does a good job, thanks for all your hard work! I would like to kindly request you to help me with the following issue: I need the exposed filter (Proximity: Great-circle (exposed) ) to have the functionality of select list distances, so the user doesn't have to enter the distance but rather select id from the drop down list. I need something like this:
$form['value'] = array(
'#type' => 'select',
'#title' => t('Distance'),
'#options' => array(
'' => t('Distance'),
'10' => t('10 Miles'),
'25' => t('25 Miles'),
'50' => t('50 Miles'),
'100' => t('100 Miles'),
'250' => t('250 Miles'),
'3000' => t('All'),
),
'#default_value' => $this->value[''],
);

Pls. let me know if you could hint me on any solution for the current issue.

Regards,
Oleg

Comments

Helrunar’s picture

You can do this with hook_form_alter. I have set up similar in Drupal 7

if ($form ['#id'] === "ID of your exposed filter") {
  $form ['circle']['value'] = array(
    '#type' => 'select',
    '#options' => array(
      '1' => t('1 Kilometer'),
      '5' => t('5 Kilometer'),
      '10' => t('10 Kilometer'),
      '25' => t('25 Kilometer'),
      '50' => t('50 Kilometer'),
      '75' => t('75 Kilometer'),
    ),
  );
  }

The default value comes from the settings of my exposed filter.