I'm trying to customise the mark-up of the default search results page in Drupal 6. Specifically I'd like to remove the search box and the title from the page – I know I can hide it with CSS, but I'd rather it wasn't rendered in the first place.
Ideally, in the same why that you theme a particular content type node by copying the node.tpl.php and renaming it to something like node-blog.tpl.php and then amending the mark-up accordingly – is there an equivalent way to do this for the search results page?
Best Answer
How you get the search box determines how you can hide it. Generally search boxes come from two places.
How do you remove those?
preprocess_function
in your theme, where you with some logic, can remove the variable or set it to an empty string.Alternatively, you could create a custom page.tpl.php for your search result page, where you exclude the search box, when it is printed in the page template.
So while it can be done, it requires some work in the second case if you want to purify your markup.