Posted by JohnAlbin on April 17, 2008 at 5:04pm
Jump to:
| Project: | Zen |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | JohnAlbin |
| Status: | closed (fixed) |
Issue Summary
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
#1
Committed to DRUPAL-5--1.
#2
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.
#3
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.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.
#4
Automatically closed -- issue fixed for two weeks with no activity.