Drupal 6 theme system
1 / 11

Drupal 6 Theme System - PowerPoint PPT Presentation

  • Uploaded on

Drupal 6 Theme System. Architecture Theme Templates Theme Engines Theme Hooks What’s New Theme registry Theme Inheritance Modules & Themes speak! Discusssion Tips & Tricks Discussion. Drupal’s Architecture. 3 main elements: Theme Templates Theme Engines Hooks. Why Theme Templates?.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Drupal 6 Theme System' - odessa-willis

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Drupal 6 theme system
Drupal 6 Theme System

  • Architecture

    • Theme Templates

    • Theme Engines

    • Theme Hooks

  • What’s New

    • Theme registry

    • Theme Inheritance

    • Modules & Themes speak!

    • Discusssion

  • Tips & Tricks

    • Discussion

Drupal s architecture
Drupal’s Architecture

3 main elements:

  • Theme Templates

  • Theme Engines

  • Hooks

Why theme templates
Why Theme Templates?

  • Like most CMS’ templates are used to keep design elements separate from processing logic.

  • Templates allow flexibility to change your current theme without causing problems in other parts of Drupal.

  • Drupal can be updated without breaking your design / theme.

Theme files
Theme files

When a regular Drupal page is rendered several template files are used:

  • Page.tpl

  • Node.tpl

  • Block.tpl

  • Comment.tpl

  • Template.php (customizations)

  • Etc…

Theme engines
Theme Engines

What is a theme engine?

  • Consists of a set of files that handles rendering data.

    What theme engines does Drupal support?

  • Most common: PHPTemplate

  • Smarty

  • XTemplates

Theme hooks
Theme Hooks

Like Drupal modules, Themes also use the hook setup to call functions and / or theme related files. Here are some things Drupal does with theme hooks:

  • Registering & handling theme files

  • Searches and loads specified theme files instead of calling the hook

  • Modules can use theme hooks to format data.

What s new theme registry
What’s New – Theme Registry

Drupal's theme registry maintains cached data on the available theming hooks and how to handle them.

Learn more about the theme registry and how to override it:


What s new theme inheritance
What’s New – Theme Inheritance

What is Theme Inheritance?

  • Is where new themes can draw assets from other themes, like stylesheets, tpl files, js etc.

    Theme inheritance allows great flexibility to make your own theme quickly.

    … Also, great for beginners to learn the theme layer.

What s new modules themes
What’s New – Modules & Themes

In the new theme system module files can create their own template files and push data to them.


  • Can skip doing phptemplate_var() in the template.php file – by pulling tpl files from the module.

  • Or, skip overriding files and work in the template.php file with the preprocess function.

  • Preprocess function? Friend or Foe?

Tips tricks discussion
Tips & Tricks - Discussion

What are some tricks you use often in the theme layer?

What would you like to do in the theme layer but do not know how or if it is possible?