function template_preprocess_search_results
7.x search.pages.inc | template_preprocess_search_results(&$variables) |
6.x search.pages.inc | template_preprocess_search_results(&$variables) |
Process variables for search-results.tpl.php.
The $variables array contains the following arguments:
- $results: Search results array.
- $module: Module the search results came from (module implementing hook_search_info()).
See also
File
- drupal-7.x/
modules/ search/ search.pages.inc, line 84 - User page callbacks for the search module.
Code
function template_preprocess_search_results(&$variables) {
$variables['search_results'] = '';
if (!empty($variables['module'])) {
$variables['module'] = check_plain($variables['module']);
}
foreach ($variables['results'] as $result) {
$variables['search_results'] .= theme('search_result', array('result' => $result, 'module' => $variables['module']));
}
$variables['pager'] = theme('pager', array('tags' => NULL));
$variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'];
}