function hook_search_item

You are here

4.6 core.php hook_search_item($item)

Format a search result.

This hook allows a module to apply custom formatting to its search results.

Parameters

$item: The search result to display, as returned in an array by hook_search().

Return value

A string containing an HTML representation of the search result.

Default formatting can be had by omitting this hook and returning your search results as arrays with the right keys. See hook_search().

Related topics

1 function implements hook_search_item()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

theme_search_item in modules/search.module
Format a single result entry of a search query.
1 invocation of hook_search_item()
theme_search_item in modules/search.module
Format a single result entry of a search query.

File

developer/hooks/core.php, line 840
These are the hooks that are invoked by the Drupal core.

Code

function hook_search_item($item) {
  $output .= ' <b><u><a href="' . $item['link'] . '">' . $item['title'] . '</a></u></b><br />';
  $output .= ' <small>' . $item['description'] . '</small>';
  $output .= '<br /><br />';

  return $output;
}