function node_is_page

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

Parameters

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

Return value

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

6 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.
statistics_node_view in drupal/core/modules/statistics/statistics.module
Implements hook_node_view().

... See full list

File

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

Code

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