I'm trying to do something that seems fairly basic, but I'm having loads of trouble.
The drupal search_form block outputs an input field and a submit button, in that order. I'd like to swap the order of those fields. I'm using theme_preprocess_search_block_form
to attempt to reverse the order. This is my current function:
function mytheme_preprocess_search_block_form(&$data)
{
$data['form']['search_block_form']['#attributes']['placeholder'] = 'Search ...';
$data['form'] = array_reverse($data['form']);
foreach(element_children($data['form']) as $k) {
if(!empty($data['form'][$k]['#weight'])) {
$data['form'][$k]['#weight'] *= -1;
}
}
$data['form']['#sorted'] = FALSE;
}
This function does get called, since a var_dump
will output to the browser, however, the changes don't make it to the front end. So, what is unchanging my changes?