As an example, the hook_search_execute function returns the following array:
$results[] = array(
'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
'type' => check_plain(node_type_get_name($node)),
'title' => $node->title,
'user' => theme('username', array('account' => $node)),
'date' => $node->changed,
'node' => $node,
'extra' => $extra,
'score' => $item->calculated_score,
'snippet' => search_excerpt($keys, $node->body),
);
'link'
and 'title'
are required and the others are optional. However, what if I wanted to add my element to the array like 'photo'
and then have that available in the $search-result.tpl.php file?
Whe I add that element to the search results array, I indeed see it when I do a dump of $variables in _preprocess_search_result(). If it's available there, then how to I make it available as <?php print $photo; ?>
in search-result.tpl.php?