function node_is_page

Checks whether the current page is the full page view of the passed-in node.

Parameters

Drupal\node\Node $node: A node entity.

Return value

The ID of the node if this is a full page view, otherwise FALSE.

7 calls to node_is_page()
book_node_view_link in drupal/core/modules/book/book.module
Adds relevant book links to the node's links.
comment_node_view in drupal/core/modules/comment/comment.module
Implements hook_node_view().
forum_node_view in drupal/core/modules/forum/forum.module
Implements hook_node_view().
hook_view in drupal/core/modules/node/node.api.php
Display a node.
NodeRenderController::alterBuild in drupal/core/modules/node/lib/Drupal/node/NodeRenderController.php
Overrides Drupal\Core\Entity\EntityRenderController::alterBuild().

... See full list

File

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

Code

function node_is_page(Node $node) {
  $page_node = menu_get_object();
  return !empty($page_node) ? $page_node->nid == $node->nid : FALSE;
}