Views: Modify filter/argument when no results occur I currently have a "store locator" proximity search setup very similar to the one detailed here: http://www.youtube.com/watch?v=AxeskzN8BAc.

The user enters a postcode, and receives results or no results as the case may be, for a given rectangular distance (say 100km around the entered postcode). Both postcode and distance are exposed filters.

If a node/marker isn't within the zone, I get no results. How can I dynamically modify or widen the distance so there are always some results? ie. How can I hook onto the exposed filter arguments and re-run the view for the no-results case?
You can call the view programatically and if no result are found call it again with new filter arguments.

For example:
    $view_id = 'your view id';
    $display_id = 'your display id';

$view = views_get_view($view_id);
$view-&gt;preview($display_id, $views_args);

if (!count($view-&gt;result)) {
  // No results, call view again with other filter value.
  $filter_name = 'your filter name';
  $filter_value = 'your filter value';

  $view = views_get_view($view_id);
  $view-&gt;preview($display_id, $views_args);
  $view-&gt;display['default']-&gt;display_options['filters'][$fiter_name]['value'] = $filter_value;
  $view-&gt;preview($display_id, $views_args);
}


You will have to adapt it using your current filter name and right values. You can rewrite this example to modify the view all the times you need. 

Put this code in a hook_menu callback returning the  view.