Zen already has THEME_preprocess_HOOK() functions, but we missed the THEME_preprocess() function which allows you to insert variables into every template file.

Comments

JohnAlbin’s picture

Status: Active » Fixed

Committed to DRUPAL-5--1.

NikLP’s picture

John,

is this an effective replacement for the generic _phptemplate_variables function? I noted that it was not possible to add variables to page/node/comment in 1.0 unless you did that separately - does this bring back the ol' classic case 'page', etc?

Do you have a quick example snippet...? :)

Thanks.

JohnAlbin’s picture

Just to clarify for those playing at home, this change simply adds a SUBTHEME_preprocess(&$vars, $hook) function to the STARTERKIT/template.php file. Drupal 6 has this preprocess function, so Zen should too.

does this bring back the ol' classic case 'page', etc?

I hope not! The SUBTHEME_preprocess() function should only be used in the special case where you want to add the same variable to every template file.

You can see example code in the just released Zen 5.x-1.1. There’s also 1.0->1.1 upgrade instructions online.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.