Prepares variables for search results templates.
Default template: search-results.html.twig.
array $variables: An array with the following elements:
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'][] = array(
'#theme' => 'search_result',
'#result' => $result,
'#module' => $variables['module'],
);
}
$variables['pager'] = array(
'#theme' => 'pager',
'#tags' => NULL,
);
// @todo Revisit where this help text is added, see also
// http://drupal.org/node/1918856.
$variables['help'] = search_help('search#noresults', drupal_help_arg());
$variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'];
}