Hi Tom,
I created two patches for tendu/tempalte.php and tendu/tendu_default/template.php (patches attached accordingly).
These patches make it easier for sub themes to add/override tendu base theme without hacking the base.
What i did is to pass an array of the sub theme body classes (called $vars['sub_body_classes_array']) to the base theme. this way it can be merged with the base theme's body_classes array.
I also added keys to the body_classes array so keys could be overridden if wanted to by the sub theme (just declare the same key in the sub_body_classes_array on tendu_default/template.php).
p.s - i hope the patches I made are OK (i patched tendu-6.x-2.1-beta5 because I could find the HEAD version). any whys I attached the code as plain text in the attached zip file
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | tendu-sub-body-classes.patch | 3.77 KB | gavri |
| tendu_sub_body_classes.zip | 4.99 KB | gavri | |
| tendu.tendu_default.template.php-sub-budy-classes.patch | 1.05 KB | gavri | |
| tendu.template.php-sub-budy-classes.patch | 2.21 KB | gavri |
Comments
Comment #1
tombigel commentedcool, thanks.
I'll look into it soon.
btw - the active dev version is branch DRUPAL-6--2, try to create a patch from that ver.
Comment #2
stevenpatzComment #3
gavri commentedI made a patch against the HEAD I hope this time I made it right :)
Comment #4
tombigel commentedno, not against HEAD (I should use the Yuval's technique - leave HEAD empty), it is not updated. Do it against DRUPAL-6--2.
Comment #5
tombigel commented@gavri:
I just stumbled upon this issue too, The base overrides drupal defaults, and the subtheme is supposed to override the base, BUT, the base uses themeName_preprocess_page and the subtheme phptemplate_preprocess_page, and the first one (themeName) takes precedence.
So, actually, the only change that is needed is one of the 2:
1. not to override $body_classes in the base
2. just change the function name in the base to phptemplate_preprocess_page or to subthemeName_preprocess_page in the subtheme.
I'll fix that in DEV soon.
Comment #6
nicholas.alipaz commentedThis still does not seem to be fixed in the base theme.
I was only able to get the $body_classes variable to register by changing the base theme to have phptemplate_proprocess_page instead of tendu_proprocess_page. I then did subthemename_proprocess_page in my subtheme and it worked.
Comment #7
nicholas.alipaz commentedAfter more testing, the fix I previously spoke of only seemed to be temporary. Whilst some time passed the base theme's preprocess function started to override my subtheme. I could only resort to removing the preprocess function from the base theme.
Comment #8
nicholas.alipaz commentedAny update on this issue?