Skip to content

Instantly share code, notes, and snippets.

@mattfarina
Created December 22, 2010 18:08
Show Gist options
  • Save mattfarina/751854 to your computer and use it in GitHub Desktop.
Save mattfarina/751854 to your computer and use it in GitHub Desktop.
Make Drupal 7 search button an image button.
/**
* Implements hook_form_alter().
*
* Courtesy of JohnAlbin
*/
function THEMENAME_form_search_block_form_alter(&$form, &$form_state) {
$form['actions']['submit']['#type'] = 'image_button';
$form['actions']['submit']['#src'] = drupal_get_path('theme', 'THEMENAME') . '/images/button-search.png';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment