By editor, 2 December, 2015 Question How to get the node or node ID (nid) from url ? Example: $node = \Drupal::routeMatch()->getParameter('node'); if ($node) { $nid = $node->id(); } Tags Drupal 8 Code Node Drupal 8 Url Tips. Get Name, Path, Args ... Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments