Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. node.module

function node_is_page

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

Parameters

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

Return value

bool TRUE if this is a full page view, otherwise FALSE.

1 call to node_is_page()
template_preprocess_node in core/modules/node/node.module
Prepares variables for node templates.

File

core/modules/node/node.module, line 194

Code

function node_is_page(NodeInterface $node) {
    $route_match = \Drupal::routeMatch();
    if ($route_match->getRouteName() == 'entity.node.canonical') {
        $page_node = $route_match->getParameter('node');
    }
    return !empty($page_node) ? $page_node->id() == $node->id() : FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal