1: I installed Drupal via my hosting companies Plesk 'Applications' menu; Drupal 6.1 was installed.
2: I installed zen. Zen theme worked, CSS classes were added to body tag, layout was correct.
3: I then created a sub-theme as directed. Body tag was missing all CSS classes. I played with the various template files, searched the bug database, etc. No luck.
4: Upgraded my Drupal install to 6.19. Subtheme now works as advertised.
4.a: This may have been something specific to my hosting provider; Drupal 'update' does blow away ALL files, after all.

As the version statement claims 6.x, I figured I'd file this just in case it wasn't something particular to my hosting provider.

Comments

Doud’s picture

Title: body tag not getting classes when Zen is installed on Drupal 6.1 » I'm getting the same issue on a fresh install of Drupal 6.19

Hi,

I'm getting the same issue on a fresh install of Drupal 6.19.

As usual when i'm starting a new site, I have installed Drupal and some basic modules (admin_menu, cck and views).
Then I installed Zen, which was working correctly.
I duplicated the STARTERKIT folder in sites/all/themes and have done the usual configuration when starting a new zen sub theme.

I then got the same issue, that i easily fixed by replacing

<?php print $classes; ?>

By

<?php print implode(' ',$classes_array); ?>

This is working for now but doesn't fix the problem which seems to come from the template.php file from zen theme.

Any ideas ?

Doud’s picture

Title: I'm getting the same issue on a fresh install of Drupal 6.19 » body tag not getting classes

Fixing the issue title from "body tag not getting classes when Zen is installed on Drupal 6.1" -> "body tag not getting classes"

jix_’s picture

Is the following code in your sub theme's template.php?
(And did you replace 'STARTERKIT' with your own theme name?)

/**
 * Implementation of HOOK_theme().
 */
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;
}
johnalbin’s picture

Category: bug » support

This is definitely not a bug. There is something misconfigured with your sub-theme, Doud.

@ggram Not sure why it wasn't working at first. But I'm glad its working now. My best guess is it was something to do with the theme registry cache which got flushed when you upgraded Drupal.

iNik’s picture

I think this is a bug. I'm having the same problem on a new site that uses a Zen subtheme (zen_ninesixty), but after downgrading to zen-6.x-1.1, the body classes were assigned properly.

jerseycheese’s picture

Subscribing.

I also experience this issue in a subtheme in 6.x-2.0, Drupal 6.19

Plenty of theme registry cache dumps and I do have HOOK_theme() in place, correctly named.

The only way I've been able to bring my custom classes I've added to the $classes_array is to do what Doud did, which will have to do for now:

<?php print implode(' ',$classes_array); ?>

mndonx’s picture

Subscribing

johnalbin’s picture

@iNik From the zen_ninesixty project page: “The 6-5.x version is developed by Amitaibu and is compatible with Zen-6.x-2.x.”

Older versions of Zen ninesixty are only compatible with Zen 6.x-1.x.

DanielIngraham’s picture

This is occurring within a sub theme I just created for testing purposes, following the configuration instructions exactly. It's definitely a bug.

ben_m’s picture

i get the same thing happening with a sub-sub theme of zen. template.php and theme-settings.php inside the sub-sub themes folder causes the WSOD, removing them strips the body classes - the implode fix above works tho.

gmgartner’s picture

Subscribing

silverfly’s picture

Title: body tag not getting classes » Same problem here

Subscribing...

...Having the same issue as @jerseycheese. Drupal 6.19, Zen 6.x-2.0, Zen_NineSixty 6.x-4.3

I have a sub theme of sub theme (zen 960). I get the error: (Warning: implode() [function.implode]: Invalid arguments passed in) when I use Doud's code. It does display the body classes though.

designbysoil’s picture

Any solutions?

johnalbin’s picture

Status: Active » Closed (fixed)

People are piling on different problems into this issue.

@silverfly As I stated earlier Zen_NineSixty 6.x-5.x is compatible with Zen 6.x-2.x, Zen_NineSixty 6.x-4.x and earlier is compatible with Zen 6.x-1.x. You either need to downgrade Zen or upgrade Zen_NineSixty.

@ ggranum: Oh! Re-reading I see it initially didn't work because you were using Drupal 6.1. That version is pretty old and had some bugs in it that Zen originally had to work-around. However, since those bugs were fixed in later versions of Drupal (along with several security fixes), I removed the work-arounds in Zen.

Everyone, some of you are using Zen 6.x-1.x and some Zen 6.x-2.x. They handle body classes differently, so I can't provide support for both versions in one issue. If you are having issues, please open a new ticket, specifiying the version you are using. Thanks!

BoySherman’s picture

@designbysoil: Doud's solution:

print implode(' ',$classes_array);

worked for me. Unsure why though as everything looked in place using the Zen 6.x-2.x