From Here to a Full Theme

We have been looking at sub-themes. But technically speaking, it is not that difficult to move from here to a top-level theme. Since theming is not the focus of the book, we will just glance at what it takes to create a full theme.

If the theme is based on PHPTemplates, the process of creating a top-level theme doesn't differ much from what we have done already. You will need to make sure to do a few things. Here is a short checklist:

• Create a theme .info file that doesn't set the base theme to some other theme. Instead of using the base theme directive, you should use the engine directive: engine = phptemplate.

• Create all the major templates: page.tpl.php, node.tpl.php, block.tpl. php, and comment.tpl.php. Of course, you can create others, as well.

• Add a logo.png image. Of course, you can use one of the standard Druplicon images as a starting point (http://drupal.org/node/9 06 8).

• Create a style.css file, as well as any other CSS files the theme needs. The style-rtl.css ("right to left") and print.css stylesheets are good to include.

• Add a screenshots.png image with a 150x90 screenshot of your theme.

The included Pushbutton and Bluemarine themes are good guides for getting started. In short, though, it is a small step from creating derivative themes to creating top-level themes.

More advanced PHPTemplate themes may also make use of the template.php preprocessing page, additional JavaScript files, and other rich features. Garland is an example of a complex theme.

For more information on developing themes, including links to the relevant APIs and auxiliary documents, the official Drupal theme tutorial is the best place to go:

http://drupal.org/node/16 5706.

Was this article helpful?

0 0

Post a comment