Modifica codice html form di ricerca

1 contenuto / 0 new
Modifica codice html form di ricerca

Ciao a tutti, vorrei modificare il codice html e le classi css del form di ricerca del sito che sto sviluppando.
Ho già modificato il file search-block-form.tpl.php ma vorrei scendereancora più in profondità e modificare i tag html e relative classi. Come posso fare?
Ho trovato questo codice:

<?php
/**
Customize your search form
*/
function yourthemename_form_alter(&$form, &$form_state, $form_id) {
  if (
$form_id == 'search_block_form') {
   
$form['search_block_form']['#title'] = t('Search'); // Change the text on the label element
   
$form['search_block_form']['#title_display'] = 'invisible'; // Toggle label visibility
   
$form['search_block_form']['#default_value'] = t('Search Site'); // Set a default value for the textfield
   
$form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button
   
$form['actions']['submit']['#attributes']['alt'] = "Search Button"; //add alt tag
   
unset($form['actions']['submit']['#value']); // Remove the value attribute from the input tag, since it is not valid when input type = image
   
$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/icon-search.png');
// Add extra attributes to the text box
   
$form['search_block_form']['#attributes']['onblur'] = "if (this.value == '') {this.value = 'Search Site';}";
   
$form['search_block_form']['#attributes']['onfocus'] = "if (this.value == 'Search Site') {this.value = '';}";
  }
}
?>

Ma non mi permette di cambiare il codice html o aggingere/modificare le classi css.

Grazie mille a tutti.

Drupal Version: