what I’m trying to achieve, is to for some specific nodes set admin theme. I have defined RouteSubscriberBase but how can I get node information here? This code is not working $node = Drupal::routeMatch()->getParameter(‘node’);
$route->getPath()
will return /node/{node}
class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public function alterRoutes(RouteCollection $collection) { if ($route = $collection->get('entity.node.canonical')) { $node = Drupal::routeMatch()->getParameter('node'); // dpm($node); - this will be null if ($nid == 123) { $route->setOption('_node_operation_route', TRUE); } } } }