Hello,

Is someone has an idea how to theme the search box on drupal 6 ?

I've take a look at the search.module ans saw this function

function theme_search_block_form($form) {
  return '<div class="container-inline">'. drupal_render($form) .'</div>';
}

so I've created this function in my template.php file but there's no change

function phptemplate_search_block_form($form) {
	return '<div class="another-class">'. drupal_render($form) .'</div>';
}

thanks

Comments

ericprk’s picture

I have this in my template.php file:

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));
}

and this in a new file search-theme-form.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" size="25" value="" title="Enter the terms you wish to search for." class="searchField" />
<input name="op" type="image" class="searchButton" value="Search" src="<?php print base_path() . path_to_theme() ?>/images/searchbutton.gif" alt="Search the site" />
<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'); ?>" />

This example uses an image for the search button. You can modify it to use a form button instead.

. - dot’s picture

...Deletedlookng for a developer too to stick social modules together....Deleted<?del>

woops wrong place. sorry to interupt

amoutiers’s picture

ok, but why phptemplate_search_block_form() function isn't called ?

i'm not sure it works there now an ID in the $form array