Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2008 at 14:01 UTC
Updated:
30 Jan 2009 at 02:23 UTC
Hi,
I want to be able to change the button text on exposed filters from "Apply" to something else. I am also exposing the filters in a block, so both texts need to be changed.
I've tried the following code in my template.php: -
function phptemplate_views_filters($form) {
if ($form['#view_name'] == 'property_search') {
$form['submit']['#value']='search';
}
return theme_views_filters ($form);
}
The hook is not even being called and I cannot find any theme documentation for Views2 which covers this.
How can I go about changing the text on this button?
Many thanks,
David
Comments
Comment #1
merlinofchaos commentedYou can use views-exposed-form.tpl.php (it's in views/theme) to theme the exposed filter form, or you can use hook_form_alter to change the text in the button before it gets to the form.
Comment #2
dubs commentedThanks - I can get that to work now.
Comment #3
bvienneau commentedWhich method did you use? I have the same problem.
views-exposed-form.tpl.php or hook_form_alter?
Comment #4
dubs commentedI used the views-exposed-form.top.php method. Here is a copy of the code: -
Comment #5
itowler commentedI would like to do the same thing, and change "Apply" to "Search"
Would all I have to do is add this line before the Print Button, and then comment out the print button?
Ian
Comment #6
merlinofchaos commentedThat works just fine.
Comment #7
itowler commentedIndeed,
Thanks for the tips..
Ian