drupal 8 get node from path alias
// Get node from path alias.
$path = \Drupal::service('path.alias_manager')->getPathByAlias('/this-is-the-alias');
if(preg_match('/node\/(\d+)/', $path, $matches)) {
$node = \Drupal\node\Entity\Node::load($matches[1]);
}
Also in JavaScript:
- refresh page and run function after javascript
- canvas container page offset
- javascript best way to loop through array
- javascript foreach in object
- setting property to method in child class javascript
- ajax latest version
- ionic modal navbar not showing
- blank catch js
- javascript add class
- javascript array to comma separated list
- how play audio js
- js fetch 'post' json
- jquery checkbox checked value
- react toolkit
- js object clear
- javascript search json array for date
- jquery check if screen size
- how to write a program that displays a message “It’s Fun day” if it's Saturday or Sunday today in javascript
- Selectores de jQuery
- bootstrap 4 modal popup remote url
- three js examples
- javascript insert item into array
- how store array in another array js
- check a string for unique characters javascript