By toswebdev, 14 April, 2023 $path = \Drupal::service('path_alias.manager')->getPathByAlias($article_url); if (preg_match('/node\/(\d+)/', $path, $matches)) { $node = \Drupal::entityTypeManager()->getStorage('node')->load($matches[1]); } Tags Code Snippet Drupal Drupal 10 PHP Comments Your name Subject Comment About text formats All comments go through moderation, so your comment won't display immediately.
Comments