Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save calvez/053c6aa865f2c49cfbf7a20efad13edb to your computer and use it in GitHub Desktop.
Save calvez/053c6aa865f2c49cfbf7a20efad13edb 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