O'Reilly logo

Drupal 7 First Look by Mark Noble

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

Theme API changes

Now that we have gone through the changes in the major Drupal templates and covered the major changes related to JavaScript and CSS, let's look into the changes to the actual theme API. These functions are implemented within your theme's template.php file and give you immense control over the presentation of elements within your site.

Signature changes

The first thing you will notice when you try to upgrade your Drupal 6 theme to Drupal 7 is that all functions now take a $variables array rather than a list of parameters in the method signature. This allows for consistent pre-processing of variables and makes coding easier. Unless noted otherwise later in this chapter, all parameters that used to be passed to a theme function are ...

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