function node_view

cis7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)
cle7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)
elmsmedia7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)
icor7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)
meedjum_blog7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)
mooc7 node.module node_view($node, $view_mode = 'full', $langcode = NULL)

Generates an array for rendering the given node.

Parameters

$node: A node object.

$view_mode: View mode, e.g. 'full', 'teaser'...

$langcode: (optional) A language code to use for rendering. Defaults to the global content language of the current request.

Return value

An array as expected by drupal_render().

21 calls to node_view()
book_node_export in modules/book/book.module
Generates printer-friendly HTML for a node.
comment_preview in modules/comment/comment.module
Generate a comment preview.
comment_reply in modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
ctools_node_content_type_render in sites/all/modules/ulmus/ctools/plugins/content_types/node/node.inc
Output function for the 'node' content type.
diff_diffs_show in sites/all/modules/ulmus/diff/diff.pages.inc
Create a comparison for the node between versions 'old_vid' and 'new_vid'.

... See full list

9 string references to 'node_view'
context_ctools_render_alter in sites/all/modules/ulmus/context/context.core.inc
Implementation of hook_ctools_render_alter(). Used to detect the presence of a page manager node view or node form.
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/node_content.inc
hook_trigger_info in modules/trigger/trigger.api.php
Declare triggers (events) for users to assign actions to.
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.
og_example_default_page_manager_handlers in sites/all/modules/ulmus/og/og_example/og_example.pages_default.inc
Implements hook_default_page_manager_handlers().

... See full list

File

modules/node/node.module, line 1329
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_view($node, $view_mode = 'full', $langcode = NULL) {
  if (!isset($langcode)) {
    $langcode = $GLOBALS['language_content']->language;
  }

  // Populate $node->content with a render() array.
  node_build_content($node, $view_mode, $langcode);

  $build = $node->content;
  // We don't need duplicate rendering info in node->content.
  unset($node->content);

  $build += array(
    '#theme' => 'node',
    '#node' => $node,
    '#view_mode' => $view_mode,
    '#language' => $langcode,
  );

  // Add contextual links for this node, except when the node is already being
  // displayed on its own page. Modules may alter this behavior (for example,
  // to restrict contextual links to certain view modes) by implementing
  // hook_node_view_alter().
  if (!empty($node->nid) && !($view_mode == 'full' && node_is_page($node))) {
    $build['#contextual_links']['node'] = array('node', array($node->nid));
  }

  // Allow modules to modify the structured node.
  $type = 'node';
  drupal_alter(array('node_view', 'entity_view'), $build, $type);

  return $build;
}
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.