function hook_node_search_result

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 node.api.php hook_node_search_result($node)
cle7 node.api.php hook_node_search_result($node)
elmsmedia7 node.api.php hook_node_search_result($node)
icor7 node.api.php hook_node_search_result($node)
meedjum_blog7 node.api.php hook_node_search_result($node)
mooc7 node.api.php hook_node_search_result($node)

Act on a node being displayed as a search result.

This hook is invoked from node_search_execute(), after node_load() and node_view() have been called.

Parameters

$node: The node being displayed in a search result.

Return value

array Extra information to be displayed with search result. This information should be presented as an associative array. It will be concatenated with the post information (last updated, author) in the default search result theming.

See also

template_preprocess_search_result()

search-result.tpl.php

Related topics

1 function implements hook_node_search_result()

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

comment_node_search_result in modules/comment/comment.module
Implements hook_node_search_result().
4 invocations of hook_node_search_result()
hook_search_execute in modules/search/search.api.php
Execute a search for a set of key words.
node_ds_search_execute in sites/all/modules/ulmus/ds/modules/ds_search/ds_search.module
Search on behalf of Drupal Core.
node_search_execute in modules/node/node.module
Implements hook_search_execute().
template_preprocess_views_view_row_search in sites/all/modules/ulmus/views/modules/search.views.inc
Template helper for theme_views_view_row_search

File

modules/node/node.api.php, line 668
Hooks provided by the Node module.

Code

function hook_node_search_result($node) {
  $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
  return array('comment' => format_plural($comments, '1 comment', '@count comments'));
}