Answers for "drupal 8 check if current page is node"

0

drupal 8 check if current page is node

$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
  // It's a node!
}
Posted by: Guest on April-14-2020

Code answers related to "drupal 8 check if current page is node"

Code answers related to "Javascript"

Browse Popular Code Answers by Language