O'Reilly logo

Drupal 7 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

Chapter 6. Advanced Templating

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

Introduction

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 ...

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