1.20.x node.module node_is_page(Node $node)

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

Parameters

Node $node: A node entity.

Return value

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

File

modules/node/node.module, line 1278
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);
}