Creating a new PHPTemplate

To create a new PHPTemplate, create a new directory under your themes directory, for example themes/mytheme. Then, you need to create a file called page.tpl.php in that directory. Or you may copy an existing theme and just rename the directory. For Drupal 5, consider basing your theme on Zen or Blue breeze.

page.tpl.php is the only file which is absolutely required. It overrides the theme('page') function, which outputs the final page contents, along with all the extra decorations like a header, tabs, breadcrumbs, sidebars and a footer.

You can create files to override the following functions:

The PHPTemplate package contains example template files for most of these, see box_grey for an example of page.tpl.php. Simply copy them into your theme/mytheme directory and edit them. Note that you will need to visit administer > themes for PHPTemplate to refresh its cache and recognize any new .tpl.php files.

If you want to theme a function other than the defaults listed here, you need to provide an override yourself.

Theme naming conventions

Zach Harkey - April 4, 2006 - 14:54

It should be documented that your theme's name should follow the same rules as other labels in PHP, i.e. it should start with a letter or underscore, followed by any number of letters, numbers, or underscores (no spaces, dashes, or special characters).

This is especially important in 4.7 where, for example, the regions function must match the theme name in order to work.

-zach
------------------------
harkey design

 
 

Drupal is a registered trademark of Dries Buytaert.