Closed (fixed)
Project:
Zen
Version:
6.x-1.0
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
19 Jun 2008 at 21:19 UTC
Updated:
16 Dec 2010 at 23:01 UTC
Right now STARTERKIT/template.php has
function STARTERKIT_theme(&$existing, $type, $theme, $path) {
return zen_theme($existing, $type, $theme, $path);
}
But its non-obvious how to modify that function if you want to extend that HOOK_theme for your own nefarious purposes. ;-)
I'm going to change it to:
function STARTERKIT_theme(&$existing, $type, $theme, $path) {
$hooks = zen_theme($existing, $type, $theme, $path);
// Add your theme hooks like this:
/*
$hooks['hook_name_here'] = array( // Details go here );
*/
// @TODO: Needs detailed comments. Patches welcome!
return $hooks;
}
Comments
Comment #1
johnalbinSee http://drupal.org/cvs?commit=122428
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
zmove commentedsorry, don't read this stupid post...
Comment #4
zmove commentedComment #5
akahn commentedI think a good start for making this more clear would be referring to the API documentation in the comments: http://api.drupal.org/api/function/hook_theme/6
Also, the comment could explain that
$hooks = zen_theme($existing, $type, $theme, $path);is what loads up the theme functions from the Zen base, while$hooks['hook_name_here']is where you add your subthemes hooks before returning the whole$hookscollection. It could also point out more clearly thathook_name_herecorresponds, simply, to a function somewhere in template.php.Lastly, and I'm not sure how this could be done well, is explain that what
$hooks['hook_name_here']is assigned to is an array of the arguments that the newly registered theme function takes. I don't know how this should be done, but the examples on the hook_theme() documentation page helped for me. I guess it would be best if this were documented in a handbook in a friendly way in addition to the API documentation.Basically, this was confusing for me to figure out, and I finally did it, and I want it to be more clear for others in the future. ;) Thoughts?
Comment #6
raimondious commentedI'm struggling with it right now, and still confused after reading your post. Could you explain what you did to get it working? Then I'll try to say it back to you, and maybe we can get some clear wording out of the exchange.
Comment #7
wickwood commentedI can't get this to work either.
I'm trying to theme the user registration form based on the tutorial at:
http://11heavens.com/theming-the-register-form-in-Drupal-6
I have this for my hook theme function:
And I created this preprocess function based on the others in the template.php
Finally, my user-register.tpl.php file looks like this:
But when I go to the http://www.MyDomian.com/user, all I get is a blank page. Does anyone have any idea what I'm doing wrong?
Thanks for you help in advance!
Comment #8
adpo commentedchange this
$hooks['user_register'] => array( 'arguments' => array('form' => NULL)to
$hooks['user_register'] = array( 'arguments' => array('form' => NULL)Comment #9
akalata commented