function node_show

Page callback: Generates an array which displays a node detail page.

Parameters

\Drupal\Core\Entity\EntityInterface $node: A node entity.

$message: (optional) A flag which sets a page title relevant to the revision being viewed. Default is FALSE.

Return value

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

See also

node_menu()

1 call to node_show()
node_page_view in drupal/core/modules/node/node.module
Page callback: Displays a single node.
1 string reference to 'node_show'
node_menu in drupal/core/modules/node/node.module
Implements hook_menu().

File

drupal/core/modules/node/node.module, line 1014
The core module that allows content to be submitted to the site.

Code

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

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

  // Update the history table, stating that this user viewed this node.
  if (module_exists('history')) {
    history_write($node->nid);
  }
  return $nodes;
}