I have my secondary menu with source set to primary menu set inside the left column of my theme.
The problem I have is that if there is no content in the left region, then the menu won't display.

<?php if ($left): ?>
  <div id="sidebar-left" class="section sidebar region"><div class="sidebar-inner">          
    <?php if ($secondary_menu): ?>
      <div id="secondary">
        <?php print $secondary_menu; ?>
      </div>
    <?php endif; ?>             	        
    <?php print $left; ?>
  </div></div> <!-- /sidebar-left -->
<?php endif; ?>

I've tried setting the layout variable from preprocess() in template.php and while this gets set correctly, the $body_classes are minus the 'sidebar-left' class.
How can I get the theme to add the 'sidebar-left' class (and other relevant classes) to the $body_classes? or is there another way of achieving this??

if ($vars['secondary_menu']) {		
  $vars['layout'] = 'left'; 
} 

Thanks.

Comments

Jeff Burnz’s picture

I normally use the excellent Menu block module for that sort of thing.

From the project page:

So if you’re only using your theme’s Primary links feature, you can add and configure a “Primary links (levels 2+)” block. That block would appear once you were on one of the Primary links’ pages and would show the menu tree for the 2nd level (and deeper) of your Primary links menu and would expand as you traversed down the tree.

If that doesn't do the trick let me know :)

Steve cousins’s picture

Ah, yes.. that's exactly what I'm looking for!

Thanks.