1 / 11

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. 3 main elements: Theme Templates Theme Engines Hooks. Why Theme Templates?.

Download Presentation

Drupal 6 Theme System

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

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

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

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

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

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

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

More Related