Modificando el formulario de búsqueda en Drupal 5.x
Monday, January 19th, 2009Para 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:
<?php
function phptemplate_search_theme_form($form) {
/**
* This snippet catches the default searchbox and looks for
* search-theme-form.tpl.php file in the same folder
* which has the new layout.
*/
return _phptemplate_callback('search_theme_form', array('form' => $form), array('search-theme-form'));
}
?>
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="<?php print drupal_get_token('search_theme_form'); ?>" />
Fuente:
Customising the search forms