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

Comments

tombigel’s picture

cool, 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.

stevenpatz’s picture

Title: Better body calsses suppot for sub themes » Better body classes support for sub themes
gavri’s picture

Version: 6.x-2.1-beta5 » 6.x-2.x-dev
StatusFileSize
new3.77 KB

I made a patch against the HEAD I hope this time I made it right :)

tombigel’s picture

no, not against HEAD (I should use the Yuval's technique - leave HEAD empty), it is not updated. Do it against DRUPAL-6--2.

tombigel’s picture

@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.

nicholas.alipaz’s picture

This 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.

nicholas.alipaz’s picture

After 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.

nicholas.alipaz’s picture

Any update on this issue?