Drupal Theme from Scratch ![]()
Theming a Drupal 7 Website
There are more template options than just the basic list I showed you before. Each one of those generic templates I listed in the hierarchy have brothers and sisters. And each set of siblings follows its own hierarchy...
Drupal will use the most specific template it finds. If no specific templates exist in your theme, Drupal will work its way down your theme's heirarchy. ID number based templates are the most specific, allowing us to create a template for an individual node. Node type based templates will cover all nodes of a particular content type.
There are ways to avoid having to create such specific templates using IF/Else PHP statements. I'll explain in a bit.
That's just a small list. There are templates for specific regions, fields, blocks, comments, taxonomies, views... Drupal lets you get very specific.
Templates cannot use dynamic path aliases, like those generated by the Pathauto module, in their names.
This documentation is a work-in-progress. As I continue to learn more about the software, I will try to keep this documentation updated. I'm no expert of anything, so if anyone feels they need to correct me about something I've written or wish to add some additional tips, feel free to mention it in the comments.
"Drupal 7 Theme from Scratch" was written by TenTen71 because no one else would.