drupal 6 theme functions

Post on 08-Jul-2015

3.998 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Drupal Camp LA 2008 Presentation on Drupal 6 Theme functions.

TRANSCRIPT

Drupal 6 Theme Functionsby Blake Lucchesi

1

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

Thank You

Thank you for joining me at DrupalCampLA!

12

top related