Discover Existing Theme Hook Suggestions for Drupal 8 and Drupal 9

Last updated July 22, 2020
Theming8.9.x/9.0.x

When determining which template file to use to theme an element, Drupal uses the list of theme hook suggestions to look for the best match. This allows for fine-grained control over how things appear based on dynamic state and contextual information in your application. The list of theme hook suggestions varies for each base template, so we need a way to figure out our options.

In this tutorial we'll look at:

  • How to determine the list of valid theme hook suggestions for any template file