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:
Navigate to the
sites/all/themes/zen/templates
folder which contains the default templates.Copy the
page.tpl.php
file.Paste it into the
sites/all/themes/myzen/templates
folder.Open this file in an editor.
Scroll down looking for any usage of the $messages variable. It should be located in a code...