O'Reilly logo

Drupal 7 Development by Example Beginner's Guide by Kurt Madel

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

Time for action — implementing hook_preprocess_node

We are going to implement the hook_preprocess_node hook. However, rather than adding it to a module, we are going to add it to our custom d7dev_theme.

Tip

The template.php file is the place where you would typically add custom code to override theme-able output to include implementations of preprocess nodes. The hook_preprocess_node hook provides a way to manipulate the Render Array of a node before it is themed as HTML.

  1. In Aptana Studio, open the template.php file in the /sites/all/themes/d7dev_theme directory.
  2. Read the contents of the template.php file, and you will learn that the Omega base theme provides a custom way of handling certain aspects of adding custom functionality to your Omega based ...

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