Customising/theming the search box in Drupal

I've been doing a lot of work with Drupal recently. The documentation is somewhat unreliable on their site. I've found quite a few instances where there has been code that doesn't work or at least now in my version of drupal. If you're having issues with customising the search box, try using this code instead in your theme.

I've been doing a lot of work with Drupal recently. The documentation is somewhat unreliable on their site. I've found quite a few instances where there has been code that doesn't work or at least now in my version of drupal. If you're having issues with customising the search box as demonstrated in this article, try using this code instead in your theme (search-box.tpl.php):

<label for="search_theme_form_keys">Search</label><input type="text" maxlength="128"   name="search_theme_form_keys"  id="edit-search_theme_form_keys"  title="Enter the terms you wish to search for."  class="form-text" /><input type="submit" name="op" value="Search" /><input type="hidden"  name="form_id"   id="edit-search-theme-form"  value="search_theme_form"/><input type="hidden"   name="form_token"  id="a-unique-id"  value="<?php print drupal_get_token('search_theme_form'); ?>"/>

About the Author

Steve Temple, Technical Director and co-founder of Gibe

Steve is the super brain behind the development of our major projects. With over 20 years of commercial experience, Steve is an expert in .NET, Umbraco and Microsoft technologies. Steve is also an Umbraco Certified Master and Microsoft MCSD