Intercepts and Overrides

In this chapter, we dive into the most powerful technique for customizing the output of a Drupal site — the use of intercepts and overrides. The logical consistency of the Drupal architecture lays the foundation for the approaches discussed in this chapter. Through the application of simple naming conventions, you can intercept and override the system's default templates. By creating your own templates and naming them properly, it is a relatively easy matter to gain control over the output of the Drupal site. The techniques discussed in this chapter enable you to change the way pages appear, and dictate different templates for different types of content, or even different users.

Intercepts and overrides can be applied to two different but closely intertwined concepts: Drupal's Cascading Style Sheets (CSS) and themeable functions. This chapter discusses each separately, but the underlying principles that empower the use of intercepts and overrides are exactly the same for both topics.

For the purpose of illustrating the examples in this chapter, we will be using the Garland theme, bundled with your default Drupal distro.

0 0

Post a comment