This module provides a service to easily retrieve the currently viewed node entity on a Drupal site. This allows developers to access the node object directly within their code.
Get a simple currently browsing Node Entity.
Usage
/** @var \Drupal\current_node_getter\CurrentNodeGetter */
$current_node_getter = \Drupal::service('current_node_getter');
/** @var \Drupal\node\Entity\Node */
$node = $current_node_getter->getEntity();
Ask your assistant about Current Node Getter
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 9–10 | Mar 15, 2023 |