Community Documentation

node_show

5 node.module node_show($node, $cid)
6 node.module node_show($node, $cid, $message = FALSE)
7 node.module node_show($node, $message = FALSE)
8 node.module node_show($node, $message = FALSE)

Generate an array which displays a node detail page.

Parameters

$node: A node object.

$message: A flag which sets a page title relevant to the revision being viewed.

Return value

A $page element suitable for use by drupal_render().

▾ 2 functions call node_show()

node_page_view in modules/node/node.module
Menu callback; view a single node.
poll_results in modules/poll/poll.pages.inc
Callback for the 'results' tab for polls you can vote on

File

modules/node/node.module, line 1401
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

<?php
function node_show($node, $message = FALSE) {
  if ($message) {
    drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title, '%date' => format_date($node->revision_timestamp))), PASS_THROUGH);
  }

  // For markup consistency with other pages, use node_view_multiple() rather than node_view().
  $nodes = node_view_multiple(array($node->nid => $node), 'full');

  // Update the history table, stating that this user viewed this node.
  node_tag_new($node);

  return $nodes;
}
?>

Comments

Description says

Description says drupal_page_render(), there is no such function, should be drupal_render().

Login or register to post comments