function hook_search_page
7.x search.api.php | hook_search_page($results) |
6.x core.php | hook_search_page($results) |
Override the rendering of search results.
A module that implements hook_search() to define a type of search may implement this hook in order to override the default theming of its search results, which is otherwise themed using theme('search_results').
Note that by default, theme('search_results') and theme('search_result') work together to create a definition list. So your hook_search_page() implementation should probably do this as well.
Parameters
$results: An array of search results.
Return value
An HTML string containing the formatted search results, with a pager included.
See also
Related topics
1 invocation of hook_search_page()
- search_data in drupal-6.x/
modules/ search/ search.module - Perform a standard search on the given keys, and return the formatted results.
File
- documentation-6.x/
developer/ hooks/ core.php, line 2050 - These are the hooks that are invoked by the Drupal core.
Code
function hook_search_page($results) {
$output = '<dl class="search-results">';
foreach ($results as $entry) {
$output .= theme('search_result', $entry, $type);
}
$output .= '</dl>';
$output .= theme('pager', NULL);
return $output;
}