Drupal 11: Print Label Of Content Type Bundle In Twig

To print the label of a content type in Twig use the following. 

{{ node.type.entity.label() }}

This is useful when printing search results, it allows you to print "Event" instead of the machine name of "event", which is accessed via node.bundle.

Add new comment

The content of this field is kept private and will not be shown publicly.