Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Using the theme developer module

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    We've been talking a lot in this series about
  • 0:09
    template files and all the variables that are available
  • 0:12
    inside of those template files and all the different template files
  • 0:15
    that exist inside of a Drupal site.
  • 0:17
    Things like the page template file, the node template file.
  • 0:20
    If we look at any of those template files,
  • 0:21
    like our node template file, for example,
  • 0:24
    there's all kinds of variables that are available inside of this template file
  • 0:27
    that contain content that we can print out to the page.
  • 0:30
    The actual content of the node, the tags that are attached to the node,

Using the Theme Developer Module

Loading...

Walks through the process of enabling the theme developer module and showing the themer info, which is like Firebug for Drupal theming. You can choose specific elements on the page to see what Drupal template files or theme functions were involved with outputting it to the screen. You can easily look at the candidate template names that are available, as well as see all of the variables that are available from that template file. A list of documented variables can be found within the node module's node.tpl.php file, but sometimes there are undocumented variables that are coming from contributed modules or elsewhere. It's a super handy tool to have available, but only enable it when you really need it since it can adversely affect the mark-up on your page and cause some wonky behavior.

Additional notes:
The Theme Developer module is on Drupal.org at http://drupal.org/project/devel_themer. Once you find a module on Drupal.org, you can see the "machine name" for the module in the URL (it is the same name as is used to for the module's .info file as well). That is the name that Drush uses. So, in this instance, Drush is looking for "devel_themer".
drush dl devel_themer