Para modificar el formulario de búsqueda en un tema de Drupal 5, primero hay que añadir la función que llame a la nueva plantilla en el fichero template.php, para ello añadimos el siguiente código:
<div class="codeblock"><span style="color: #000000;"><span style="color: #0000bb;"><?php
</span><span style="color: #007700;">function </span><span style="color: #0000bb;">phptemplate_search_theme_form</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$form</span><span style="color: #007700;">) {
</span><span style="color: #ff8000;">/**
* This snippet catches the default searchbox and looks for
* search-theme-form.tpl.php file in the same folder
* which has the new layout.
*/
</span><span style="color: #007700;">return </span><span style="color: #0000bb;">_phptemplate_callback</span><span style="color: #007700;">(</span><span style="color: #dd0000;">'search_theme_form'</span><span style="color: #007700;">, array(</span><span style="color: #dd0000;">'form' </span><span style="color: #007700;">=> </span><span style="color: #0000bb;">$form</span><span style="color: #007700;">), array(</span><span style="color: #dd0000;">'search-theme-form'</span><span style="color: #007700;">));
}
</span><span style="color: #0000bb;">?></span></span></div>
Despues creamos un fichero nuevo en el directorio del tema llamado search-theme-form.tpl.php y añadimos el siguiente código que modificaremos a nuestro antojo.
<label for="search_theme_form_keys">Custom Search</label> <input type="text" maxlength="128" name="search_theme_form_keys" id="edit-search_theme_form_keys" size="25" value="" 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="<span style="color: #000000;"><span style="color: #0000bb;"><?php </span><span style="color: #007700;">print </span><span style="color: #0000bb;">drupal_get_token</span><span style="color: #007700;">(</span><span style="color: #dd0000;">'search_theme_form'</span><span style="color: #007700;">); </span><span style="color: #0000bb;">?></span></span>" />
Fuente:
Customising the search forms