1

I have the code below in my theme to detect if there is a block in the leftsidebar region. The problem is that this HTML code still gets output on pages that do not have a block in the leftsidebar region. I am at a complete loss as to what the problem is. I do this same code with my other blocks and it works.

Here's the code in my page.tpl.php file...

<?php if (!$page['sidebar']): ?>
<div id="content-area" class="one-col">
<?php endif; ?> 

<?php if ($page['sidebar'] && !$page['leftsidebar']): ?>
<div id="content-area" class="two-col">
<?php endif; ?> 

<?php if ($page['leftsidebar']): ?>
<div id="content-area" class="three-col">
<?php endif; ?> 

Here's the block region in my .info file...

regions[leftsidebar] = Left Sidebar
apaderno
  • 28,547
  • 16
  • 75
  • 90
Dustin
  • 4,314
  • 12
  • 53
  • 91

1 Answers1

1

Just check <?php if($leftsidebar): ?>. then add all your markup.

au_stan
  • 4,011
  • 2
  • 19
  • 24