Change the order of the 'Search this site' form in Drupal
-
19-09-2019 - |
Question
I need to change the layout of the Search Block in Drupal. It’s currently ordered
Search Button > ‘Search this site’ > Search Input
but the designs I have want it to be
Search Input > ‘Search this site’ > Search Button
How do I go around changing the order in Drupal? I can change the search-block-form.tpl.php
so the submit button is at the end but the ‘Search this site’ always appears before the input and I would like it after.
I hope that makes sense. I can also do it using CSS but I’d prefer to use Drupal?
Many thanks in advance
Solution
You can use one of the following two theme preprocessing functions to do that. The one to use depends on if you're using the search block or just embedding the search form into your .tpl.php
http://api.drupal.org/api/function/template_preprocess_search_block_form/6 http://api.drupal.org/api/function/template_preprocess_search_theme_form/6