Book Image

Drupal 5 Themes

Book Image

Drupal 5 Themes

Overview of this book

Drupal is an award winning open source Content Management System. Based on PHP/MySQL, its power and flexibility combined with its exceptional design mean it is already on the way to becoming the de facto standard for CMS Websites. Drupal?¢‚Ǩ‚Ñ¢s modular design and structured source code make it both highly flexible and easily extended and modified. Drupal is extremely scalable, making it ideal for both a simple personal website as well as an industrial strength commercial or institutional web presence.Drupal is a model open source project in that it has a large, friendly community of people who contribute to the project in various ways. Drupal is not only free and easy to use, but this community provides on going mutual support.
Table of Contents (14 chapters)
Drupal 5 Themes
Credits
About the Author
About the Reviewer
Preface
Appendix A

Extending Your PHPTemplate Theme


Working with Template Variables

Drupal produces variables that can be used to enhance the functionality of themes. Typically, a function is placed in a template file. The function returns values reflecting the state of the template. A function may indicate, for example, whether the page is the front page of the site, or whether there are one, two, or three active columns. Tapping into this information is a convenient way for a theme developer to style a site dynamically.

The default Drupal variables cover the most common (and essential) functions, including creating unique identifiers for items. Some of the Drupal variables are unique to particular templates, others are common to all. In addition to the default variables, you can also define your own variables.

Let's look first at the default Drupal variables, then at intercepting and overriding the default variables, and finally, at creating your own variables.

Variables Available in block.tpl.php

The system...