I have notice that template_preprocess_page() is not detecting the new "Sidebar First" as either "Sidebar Left" or "Sidebar Right".

When printing the keys of $variables I get "sibebar_first" and "sidebar_second", however template_preprocess_page() is looking for "left" or "right" and if none of them is found then the "layout" variable is set as "none" causing that zen_preprocess_page() add the class "no-sidebars" to the body.

How can I solve this?

I also notice that none of the sidebar where wrapped in any container but there was css code for those expected containers.

I have read the documentation so I'm sorry if this is not a real bug and I missed the part that explain this.

Comments

altrugon’s picture

Status: Active » Fixed

Ok, here is the "problem". If you create your own template_preprocess_page() for you theme, make sure you copy all the code from zen_preprocess_page() there because it is in this code where the control of the names for the sidebars is.

For more information here I leave a snap of zen_preprocess_page() code where the explanation for the sidebar names is:

...
  // We need to re-do the $layout and body classes because
  // template_preprocess_page() assumes sidebars are named 'left' and 'right'.
  $vars['layout'] = 'none';
  if (!empty($vars['sidebar_first'])) {
    $vars['layout'] = 'first';
  }
  if (!empty($vars['sidebar_second'])) {
    $vars['layout'] = ($vars['layout'] == 'first') ? 'both' : 'second';
  }
  // If the layout is 'none', then template_preprocess_page() will already have
  // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar.
  if ($vars['layout'] != 'none') {
...

Status: Fixed » Closed (fixed)

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

ecvandenberg’s picture

Status: Closed (fixed) » Active
Issue tags: +zen, +sidebar, +subtheme

This issue was automatically closed, but I think I have the same issue as altrugon. So I would like to re-open it.

I used to work with Zen version 6.x 1.1. All worked fine. Today I updated to version 2.0. I used the starterkit to create a new theme. In my new theme, the content region always takes the "no-sidebars" lay-out. No matter what side-bars there are. Resulting in the sidebars overflowing the content.

When I select the Zen theme itself, the content and sidebars work as expected.

The mentioned fix does not make sense to me, because I did not create my own template_preprocess_page() for my theme as far as I know.

Can anyone help?

ecvandenberg’s picture

Status: Active » Closed (works as designed)

Oops, I did not complete the install procedure. I should have read the manual completely!

windmaomao’s picture

Component: PHP Code » layout.css

@ecvandenberg, i had the same issue. what do you mean by "read the manual" ? what did you do to solve this issue ? Thanks

ecvandenberg’s picture

Wow...this is a long time ago. I think I meant the readme.txt file in the STARTERKIT folder. I remember vaguely that I read the Readme file too quick and skipped something.

So my advice is...read the manual carefully and follow it step by step.

Zen 6.x-2.0 works fine.