/**
* Return a themed search box.
* Add suffix and prefix, remove label
*/ function YOUR_THEME_NAME_search_theme_form($form){ $output = ''; // Unset search field title unset($form['search_theme_form']['#title']); // Unset submit button so only Enter keypress form submission availavle unset($form['submit']); // Add some text behind search form $form['search_theme_form_description'] = array( '#type' =>'markup', '#value' =>'<div id="search-box-description">' . t('Search this site by keyword or phrase') .'</div>', '#weight' => -10, ); $form['search_theme_form']['#weight'] = 0; // Add wrapper for some CSS tricks $form['search_theme_form']['#prefix'] = '<div id="search-box-wrapper" class="r3-all">'; $form['search_theme_form']['#suffix'] = '<span id="search-box-submit"></span></div>'; // Render and return form $output .= drupal_render($form); return$output; }
Комментарии
* Return a themed search box.
* Add suffix and prefix, remove label
*/
function YOUR_THEME_NAME_search_theme_form($form) {
$output = '';
// Unset search field title
unset ( $form['search_theme_form']['#title'] );
// Unset submit button so only Enter keypress form submission availavle
unset ( $form['submit']);
// Add some text behind search form
$form['search_theme_form_description'] = array(
'#type' => 'markup',
'#value' => '<div id="search-box-description">' . t('Search this site by keyword or phrase') .'</div>',
'#weight' => -10,
);
$form['search_theme_form']['#weight'] = 0;
// Add wrapper for some CSS tricks
$form['search_theme_form']['#prefix'] = '<div id="search-box-wrapper" class="r3-all">';
$form['search_theme_form']['#suffix'] = '<span id="search-box-submit"></span></div>';
// Render and return form
$output .= drupal_render($form);
return $output;
}
По моему проще через hook_form_alter(). Кода намного меньше.
еще проще в css: #search-theme-form label {display: none;}
Блин, чет я и не догадался через css спрятать)))