This is an exmaple of custom Drupal module that modifies portions of the Geofield module.
- Alter Geofield exposed filter
- Change distance textfield to select box
- Default unit to miles and hide the unit selector
- Download and place all files in your modules folder
- Enable the module
- Go to the page with your geofield exposed filter
- Take note of the view name and display name printed in the message area
- Open the geofield_customizer.module file
- Insert your view name and display name to
views-exposed-form-VIEW-NAME-DISPLAY-NAME'
- Insert your view name and display name to
if ($form_state['view']->name == 'VIEW-NAME' && $form_state['view']->current_display == 'DISPLAY-NAME')
- Save and reupload the geofield_customizer.module file
- Flush all caches on your drupal site
- Reload your page with the geofield exposed filter on it
Special thanks to cmonnow on drupal.org for the initial code.
Thanks for this. Saved me tons of time and you just taught me how to write a custom module.