Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
Credits
About the Author
About the Reviewers
Preface

Theming Inside a Module


Once the philquotes_block() function has obtained the content of a quote, it must add some formatting and styling to the data. This is handled with functions that make use of the theme system. And the first stage is handled with the theme() function.

We took a look at the theme() function in the last chapter. But there we were primarily interested in creating themes. Here, we are working on a module. In the module, we want to provide some default theming, but in a way that makes use of the theme system. This provides more flexibility: theme developers can change the layout of our module without having to change any of our code.

Note

Default Themes

Often, a module adds content that existing themes do not already provide layout information for. In such cases, the module developer should provide a default theme. A default theme should provide layout information for the new content that the module makes available.

The theme() function is called in philquotes_block() with...