[development] make a hook_theme_variables that extends the job of _phptemplate_variables

Adrian Rossouw adrian at bryght.com
Sat May 6 11:27:59 UTC 2006

On 06 May 2006, at 10:43 AM, Robert Douglass wrote:

> one of the most useful things about PHPTemplate is the template.php  
> file. One of the most useful things about template.php is the  
> _phptemplate_variables. Why don't we extend this to be a module  
> hook that lets module access the variable stack prior to being sent  
> to any template? This would solve the problem that I ran into in  
> page_title.module where the module is dependent on an alteration to  
> the _phptemplate_variables function.
This would be accomplished by moving the phptemplate template loading  
code into core. In fact, this was part of my original design for the  
template system.
The _variables function is also the prototype of the _infinitely_  
useful _form_alter hook.

It could be really useful to have any module expose extra things that  
can be placed in template.
Like the privatemsg module could expose the 'message this user' link  
to any template that has a $user object =)

Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com

More information about the development mailing list