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

Theming a CCK field using a template file

While it is a quick and easy operation to manipulate markup using hook_nodeapi(), as our requirements become more complex, we inevitably need to resort to locating our customizations within a template file. Theming CCK fields using template files is just about the same as theming anything else in Drupal, albeit with a couple of caveats.

In this recipe, we will look at modifying the output of the Phone field in the company node type to use an unordered list when there are multiple items present.

Getting ready

We will be using the myzen theme created earlier in this book to hold our theme customizations. Following the recommendations outlined in earlier chapters, we will also be making use of the Devel and ...

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