Closed (outdated)
Project:
Location
Version:
6.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 May 2009 at 22:33 UTC
Updated:
19 Jul 2016 at 11:55 UTC
Jump to comment: Most recent
Comments
Comment #1
cyberwolf commentedI vote for this. We currently accomplished this with a hook_form_alter() but it would be better if the module has such an option (not exposing the distance) built-in.
Comment #2
tevih commented+1 :)
Comment #3
tevih commentedCyberwolf - did you create a custom module to accomplish this, or was this put into a template.php file? Either way, can you please outline the steps you took to get this to work?
Thanks!
Comment #4
cyberwolf commented@tevih I created a custom module for this, in the example code above just replace "mymodule" with the desired module name, and replace 'views-exposed-form-some-view-identifier-page-1' with the right form ID. Please keep in mind, I consider this as a quick and dirty fix, it would be much better if it was an option in the views filter. I'll see if I can come up with a decent patch...
Comment #5
tevih commentedthanks! I'll give this a whirl until a better solution comes up
Comment #6
chrishks commented+1 Thanks for this Cyberwolf - I just thought I would share a little amendment:
$form['distance']['search_distance']['#type'] = 'value';I found that using the above meant that the search_distance value wasn't used in the URL. My GMap view didn't seem to mind, but my table view didn't return any results. However if you change that bit to:
$form['distance']['search_distance']['#type'] = 'hidden';Then your default value (e.g. 50 miles or whatever) goes into the URL and the table view produces results again. Not anything special but slightly better than doing the equivalent in CSS.
Comment #7
legolasboClosing old D6 issues as D6 is end of life