Drupal Get Route Current Content Type

[Solved] Drupal Get Route Current Content Type | Php Frameworks Drupal - Code Explorer | yomemimo.com
Question : drupal get route current content type

Answered by : kaushik-kumar-mitra

$node = \Drupal::routeMatch()->getParameter('node');
$typeName = $node->bundle();
$typeLabel = $node->getTitle();

Source : https://stackoverflow.com/questions/31116325/how-to-programmatically-get-content-type-name-in-drupal-8 | Last Update : Fri, 04 Feb 22

Answers related to drupal get route current content type

Code Explorer Popular Question For Php Frameworks Drupal