When I use a sub-theme of a Zen sub-theme, the THEME_process functions are not run, which results in all $classes variables being blank in my templates.

Members fund testing for the Drupal project. Drupal Association Learn more


dboulet’s picture

JohnAlbin’s picture

Title: THEME_process not being run for sub-sub-theme » SUBTHEME_process functions do not work
1.41 KB

Good catch, Daniel!

But the patch isn't quite right.

JohnAlbin’s picture

Status: Needs review » Fixed


Thanks again for noticing this!

dboulet’s picture

Thanks John! It seems to work fine now. Sorry if my fix was no good, I'm new to Zen, and I'm still trying to wrap my head around it.

dboulet’s picture

Status: Fixed » Needs review

I think I spoke too soon, it's still not working right. I think that I did a bad job of describing the problem originally. What I meant is that zen_process() is not being run for my theme, which means that the classes_array variable is never converted to the classes variable. My patch still fixes the problem for me.

dboulet’s picture

Title: SUBTHEME_process functions do not work » zen_process not being run for sub-sub-theme
sunshinee’s picture

I can confirm that this is fixed in the latest dev package. Yay!

broncomania’s picture

I still got the same problem. in my case are the classes of the sidebars are not set. I think this is critical because the whole template design is crashed. I also use a subtheme. The only classes are set are from the admin menu. Maybe someone has an solution. I also upgrade to the last dev package with the same result.

dboulet’s picture

Title: zen_process not being run for sub-sub-theme » Classes are not added to the body tag when using sub-sub-theme

This is definitely not fixed. Changing the title to make the problem more clear.

dboulet’s picture

Fix that works for me:

Add this to your Zen sub-sub-theme's template.php (replace 'themename' with the name of your theme):

 * Implementation of hook_theme().
function themename_theme(&$existing, $type, $theme, $path) {
  $hooks = zen_theme($existing, $type, $theme, $path);
  return $hooks;

The bug shows up when hook_theme() is not implemented.

I'm guessing that this is a requirement of Zen, and so this isn't truly a bug?

MXT’s picture

I have the same problem, my body classes result like this: <body class="">

The issues born when I made the upgrade from 6.x-1.1 to 6.x-2.0 (in 6.x-1.1 all worked fine)

(I already have the code suggested by dboulet in my subtheme template.php)

Thank you for your work.


keesee’s picture

having he same issue. Classes are also not being assigned to the node div in subthemes.


will try fixes above and report back.


mineaeliza’s picture

Status: Needs review » Fixed

thanks dboulet, I had the same easy fix to do.

sbandyopadhyay’s picture

Status: Fixed » Needs review

It's not fixed quite yet. Can we somehow move this into Zen core so that new sub-sub-themes are automatically made with these few extra lines?

sbandyopadhyay’s picture

Status: Needs review » Fixed

Woops. I spoke too soon. This IS a part of the standard subtheme already, as per the starterkit. So when you turn a subtheme into a sub-subtheme, you should already have those few lines.

Fixed it is!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.