template_preprocess_search_results

Versions
6 – 7
template_preprocess_search_results(&$variables)

Process variables for search-results.tpl.php.

The $variables array contains the following arguments:

  • $results
  • $type

See also

search-results.tpl.php

Code

modules/search/search.pages.inc, line 60

<?php
function template_preprocess_search_results(&$variables) {
  $variables['search_results'] = '';
  foreach ($variables['results'] as $result) {
    $variables['search_results'] .= theme('search_result', $result, $variables['type']);
  }
  $variables['pager'] = theme('pager', NULL, 10, 0);
  // Provide alternate search results template.
  $variables['template_files'][] = 'search-results-'. $variables['type'];
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.