drupal 6 theme functions
Post on 08-Jul-2015
3.996 Views
Preview:
DESCRIPTION
TRANSCRIPT
Tools
Drupal 6.x Installation
Firefox
Firebug extension for Firefox
Devel Module
Text Editor
Other Modules: admin_menu
2
Theme Functions?
Functions that are declared as theme functions allow the Drupal theme to alter output before presentation.
Modules can provide a default output style and allow advanced theme builders to CLEANLY and EASILY modify their output.
3
4
5
6
Theme Developer Module
7
Template Files vs Functions
Template Files (*.tpl.php) Functions
Output is printed<?php print $variable; ?>
Build a single output variable and return it.
$output .= “output”;
Easier to use if mixing a lot of plain html.
Easier to use if using control structures and loops.
The choice is up to you.
8
Template Files
In D 6.x you can create a template file for ANY theming hook.
Automatically recognized after theme cache is cleared.
Example...
*Note the underscore being changed into a hyphen.
9
Functions
Template.php is where the party is at!
Overridden functions are placed in template.php.
Keep this file organized with comments.
If it gets too big you CAN use php’s include function to include other files.
Example...
10
Further Reading...
Online: Drupal API Docs
Online: Drupal Themes 5.x to 6.x (d.o handbook)
Online: Theme Developers Guide (d.o handbook)
Online: Drupal Theming/Sitebuilding Workshop Notes (BoldSource)
Screencast: Theme Developer Module (d.o handbook)
Group: Theme Developers (g.d.o group)
Book: Drupal 6 Themes (Packt)
11
Thank You
Thank you for joining me at DrupalCampLA!
12
top related