Determine the Base Name of a Template for Drupal 8 and Drupal 9

Last updated July 27, 2016

There are many situations in which you need to know the theme hook, or base name, of a template file. This name is used for determining things like which preprocess function affects a template, and which template files are used for theming components.

In this tutorial we'll learn:

  • How to figure out the hook name for any template