Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Drupal 6 Theming Cookbook

You're reading from   Drupal 6 Theming Cookbook Over 100 clear step-by-step recipes to create powerful, great-looking Drupal themes

Arrow left icon
Product type Paperback
Published in Nov 2010
Publisher Packt
ISBN-13 9781847198686
Length 384 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (18) Chapters Close

Drupal 6 Theming Cookbook
Credits
About the Author
About the Reviewers
1. Preface
1. Drupal Theme Basics 2. Beyond the Basics FREE CHAPTER 3. Custom Themes and Zen 4. Templating Basics 5. Development and Debugging Tools 6. Advanced Templating 7. JavaScript in Themes 8. Navigation 9. Form Design 10. Customizing CCK 11. Views Theming 12. Rapid Layouts with Panels Index

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 folder which contains the default templates.

  2. Copy the page.tpl.php file.

  3. Paste it into the sites/all/themes/myzen/templates folder.

  4. Open this file in an editor.

  5. Scroll down looking for any usage of the $messages variable. It should be located in a code...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image