O'Reilly logo

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

Displaying the last updated date instead of the submitted date

In this recipe, we will be changing the contents of the $date template variable which, by default, displays the creation date of the node, with the node's last updated date instead. This is useful in situations where the freshness of content depends on when it was last updated rather than its overall age.

Getting ready

We will be using the myzen theme created earlier in this book as the example theme in this recipe. It is also assumed that the node.tpl.php file is available in its templates folder.

How to do it...

Manipulating the $date variable can be performed using the following steps:

  1. Navigate to the myzen theme folder at sites/all/themes/myzen.
  2. Open the template.php file in an editor. ...

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