O'Reilly logo

Drupal 6 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Overriding Zen template files with myzen

Zen sub-themes, by default, use the page, node, and other template files directly from the base theme. In other words, we do not need to specify template files in our myzen theme unless we have to.

In this recipe, we are going to override the base theme's page.tpl.php template file with our own copy and make changes to it. As an example, let us see if we can reposition the status messages element which is usually represented by the $messages variable.

Getting ready

We are going to assume that the myzen sub-theme is already created and available.

How to do it...

The following steps outline the procedure to import a template file from the base theme to the sub-theme:

  1. Navigate to the sites/all/themes/zen/templates ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required