showing results for - "drupal 8 get node from path alias"
Ryad
25 Oct 2019
1// Get node from path alias.
2$path = \Drupal::service('path.alias_manager')->getPathByAlias('/this-is-the-alias');
3
4if(preg_match('/node\/(\d+)/', $path, $matches)) {
5  $node = \Drupal\node\Entity\Node::load($matches[1]);
6}
7
8// Path alias manager service has been change to 'path_alias.manager' on later version.
9$path = \Drupal::service('path_alias.manager')->getPathByAlias('/this-is-the-alias');
queries leading to this page
drupal 8 get node id from aliasdrupal 8 update path aliasget url alias of node drupal 8drupal 8 path alias managerdrupal 8 node get path alias programmaticallydrupal 8 path alias from node iddrupal 8 get aliasdrupal 7 get node id from path aliasdrupal 8 get nid from path path alias drupal nodedrupal 8 aliasdrupal 8 path aliasdrupal 8 get the full path with alias and schemedrupal 8 get node from path aliashow to get node id from url alias in drupal 8drupal 8 create path alias programmaticallydrupal 8 get node from path alias drupal 8 get alias from routedrupal 8 set alias by pathdrupal 8 get route alias fromdrupal 8 get alias by pathdrupal get path alias from niddrupal get node aliasdrupal get node id from path aliasdrupal 8 get route by aliasdrupal 8 path alias manager serviceget node by alias drupal 8alias drupal 8drupal 8 path aliasdrupal get node alias from niddrupal 8 export url aliasdrupal 8 get alias path to nodeget path alias drupal 8drupal 8 getpath aliasdrupal 8 get node from aliasdrupal 8 path alias basedrupal 8 is node has aliasdrupal 8 get page alias from node iddrupal path alias to nodedrupal 8 set path alias programmaticallydrupal 8 get path alias from urldrupal node get path aliasget alias from node drupal 8drupal 8 get path aliasdrupal 8 get alias from urldrupal 8 using nid get node aliasget node alias drupal 8drupal 8 load node by aliasdrupal path aliasdrupal 8 get current path aliaspath alias drupal 8drupal 8 get node from path alias