1 search.api.php hook_search_page($results)

Override the rendering of search results.

A module that implements hook_search_info() to define a type of search may implement this hook in order to override the default markup of search results.

Parameters

$results: An array of search results.

Return value

A renderable array, which will render the formatted search results with a: pager included.

See also

search-results.tpl.php

Related topics

File

core/modules/search/search.api.php, line 245
Hooks provided by the Search module.

Code

function hook_search_page($results) {
  return array(
    '#prefix' => '<h2>Test page text is here</h2>',
    '#theme' => 'search_results',
    '#results' => $results,
    '#module' => 'search_extra_type',
  );
}