7 August 2011
This snippet shows how to change page title on search page. For this example the title will be the content of search box(search string).
Source code viewer
function theme_preprocess_page(&$variables) // don't forget to change hook name { if(arg(0) == 'search') { // get the search string $default_value = $variables['page']['content']['system_main']['search_form']['basic']['keys']['#default_value']; // if you have searched something then change the title } }Programming Language: PHP