Preprocess functions - the what, why and how

Abstract: 
A brief introductions to the power of preprocess functions. What they are, why they are awesome, and how they can be used.
Room: 
Blue Spruce
Presentation Date: 
Sat, 2009-06-27 12:00

Preprocess functions setup variables to be placed within template files. Template files are meant to be simple, with simple php conditional logic, and minimal code. As a general rule of thumb, logic should be placed within preprocess functions and the output assigned to variables which are then printed within the template file.

One of the powers of preprocessors comes with the ability to quickly alter a variety of templates without the need to create additional template files. The more template files a theme has, the harder it is to maintain, understand and debug. Preprocess functions simplify a theme drastically by greatly reducing the number of needed template files.

This session will be highly focussed on samples, providing 'real-world' examples of how preprocess functions can be utilized to save time and energy while theming.

Pre-requisites: 
Attendees should be relatively comfortable with basic PHP and at least have a general understanding of the templating system.

Comments

Hi. Great presentation.

Hi.
Great presentation. Would you mind posting slides?

I would love to post slides

I would love to post slides from this presentation, but there were very few slides, most of the session was examples. I'll be tossing together a blog post in the future along with updating many of the docs on d.o. Thanks for your interest.

I was wondering if you could

I was wondering if you could provide the tpl and views settings you used to make the XML output. I believe this was from your session.

Presenters

In conjunction with

Ubercamp

Platinum Sponsor

Gold Sponsor

User login