Skip to main content
ComputerMinds

Customising the Drupal search block form

The Drupal search block form is one of those things that gets used in most themes, and frequently needs a bit of themeing to bring it in line with your target design.

Mike DixonSenior Mind · · 1 min read

The Drupal search block form is one of those things that gets used in most themes, and frequently needs a bit of themeing to bring it in line with your target design.

The following snippet (which needs to live in your template.php file) will change the word "Search" in the submit button to "Go", and will add a title to the search terms box ...

<code class="language-php hljs">
function phptemplate_search_block_form($form) { 
  $form['search_block_form_keys']['#title']='search the site';
  $form['search_block_form_keys']['#size']=10;  
  $form['submit']['#value']='GO!';
  return drupal_render($form);
}
</code>

Written by

Mike Dixon, Senior Mind

Meet the team