hook_search_item

Definition

hook_search_item($item)
developer/hooks/core.php, line 840

Description

Format a search result.

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

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

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.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
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;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.