Drupal Theme from Scratch ![]()
Theming a Drupal 7 Website
I said before that Drupal, by default, will use the page.tpl.php file to dictate how your home page is displayed. The page.tpl.php will control all your pages by default unless you have more templates.
The most common way to override the home page with a custom template is to take a copy of the page.tpl.php file and rename it as page--front.tpl.php. Drupal will automatically use that file instead of the page.tpl.php file for your home page.
However, to prevent having to use PHP includes for your header and footer sections and attach them to both the page.tpl.php and the page--front.tpl.php (or worse: adding the header and footer code to those files), I use a different strategy...
Now you can use page.tpl.php to hold the code of your header and footer across the site without the need for includes or needing to maintain the code in multiple files.
The only way this strategy would not work is when you need multiple page-level templates. But that need won't present itself until you require the use of unique headers and footers on different pages. And when that day comes, it's easy enough to go back to using page--front.tpl.php.
In theory you might be able to hard code your header and footer into the html.tpl.php, but you can't load blocks the same way. I may be wrong about this.
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.