Presentation is loading. Please wait.

Presentation is loading. Please wait.

Drupal 6 Theme System Architecture –Theme Templates –Theme Engines –Theme Hooks What’s New –Theme registry –Theme Inheritance –Modules & Themes speak!

Similar presentations


Presentation on theme: "Drupal 6 Theme System Architecture –Theme Templates –Theme Engines –Theme Hooks What’s New –Theme registry –Theme Inheritance –Modules & Themes speak!"— Presentation transcript:

1

2 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

3 Drupal’s Architecture 3 main elements: Theme Templates Theme Engines Hooks

4 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.

5 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…

6 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

7 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.

8 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: http://drupal.org/node/223463

9 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.

10 What’s New – Modules & Themes In the new theme system module files can create their own template files and push data to them. Benefits? 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?

11 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?


Download ppt "Drupal 6 Theme System Architecture –Theme Templates –Theme Engines –Theme Hooks What’s New –Theme registry –Theme Inheritance –Modules & Themes speak!"

Similar presentations


Ads by Google