We will cover the following recipes in this chapter:
Adding a variable to all node templates
Deleting a variable from the page template
Adding a custom theme setting
Hiding all regions on a page
Displaying the last updated date instead of the submitted date
Module-based variable manipulation
Optimizing using
hook_preprocess()
Displaying the date field in calendar form
In a bid to separate logic from presentation, Drupal's theming system tries to minimize the amount of PHP that is necessary in a template file. This ensures that themers who are not as comfortable in a PHP environment, are not exposed to the nitty-gritty of complicated code manipulations. Instead, they are provided with a host of pre-prepared variables that contain the content of the regions and blocks that make up a page, or those that describe other elements such as user details and submission information that can be utilized in the template file.
But the question arises: where do these variables...