Closed (works as designed)
Project:
Location
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2011 at 21:03 UTC
Updated:
21 Dec 2011 at 18:59 UTC
I would like to hide the "Distance" option on my exposed filter, so all the site visitor sees is the exposed field for Postal code. Is this possible in the UI?
Thanks.
Comments
Comment #1
ankur commentedThis currently isn't possible through the UI.
It can, however, be done at the code level, using an implementation of hook_form_alter() or hook_form_FORM_ID_alter().
The way to go would probably be to change the '#type' attribute of the 'distance' form element in the exposed filter from 'textfield' to 'hidden' so that it always takes on the default value configured in your exposed filter. You'd probably also want to change the label for the exposed filter to an empty string.
Feel free to re-open if you have any additional questions or to open a separate ticket if you'd like to put in a feature request where this becomes configurable.
Comment #2
jenlamptonYeah, I did a little form_alter jobby on it.
Thanks for the reply :)
Comment #3
joshfromdallas commentedCan you post an example of what you did? I am trying to do the same thing and want to alter the Zip code text, and I think this will help. I am trying to understand the hook form alter usuage.