function hook_node_view

×

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_view($node, $view_mode, $langcode)
cle7 node.api.php hook_node_view($node, $view_mode, $langcode)
elmsmedia7 node.api.php hook_node_view($node, $view_mode, $langcode)
icor7 node.api.php hook_node_view($node, $view_mode, $langcode)
meedjum_blog7 node.api.php hook_node_view($node, $view_mode, $langcode)
mooc7 node.api.php hook_node_view($node, $view_mode, $langcode)

Act on a node that is being assembled before rendering.

The module may add elements to $node->content prior to rendering. This hook will be called after hook_view(). The structure of $node->content is a renderable array as expected by drupal_render().

When $view_mode is 'rss', modules can also add extra RSS elements and namespaces to $node->rss_elements and $node->rss_namespaces respectively for the RSS item generated for this node. For details on how this is used, see node_feed().

Parameters

$node: The node that is being assembled for rendering.

$view_mode: The $view_mode parameter from node_view().

$langcode: The language code used for rendering.

See also

blog_node_view()

forum_node_view()

comment_node_view()

hook_entity_view()

Related topics

15 functions implement hook_node_view()

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

blog_node_view in modules/blog/blog.module
Implements hook_node_view().
book_node_view in modules/book/book.module
Implements hook_node_view().
cis_example_mooc_node_view in sites/all/modules/_my_modules/cis_examples/cis_example_mooc/cis_example_mooc.module
Implements hook_node_view().
comment_node_view in modules/comment/comment.module
Implements hook_node_view().
context_node_view in sites/all/modules/ulmus/context/context.core.inc
Implementation of hook_node_view().

... See full list

6 invocations of hook_node_view()
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/node_content.inc
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/node_content.inc
field_attach_view in modules/field/field.attach.inc
Returns a renderable array for the fields on an entity.
field_view_field in modules/field/field.module
Returns a renderable array for the value of a single field in an entity.
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.

... See full list

File

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

Code

function hook_node_view($node, $view_mode, $langcode) {
  $node->content['my_additional_field'] = array(
    '#markup' => $additional_field,
    '#weight' => 10,
    '#theme' => 'mymodule_my_additional_field',
  );
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.