I have a statement set up to determine whether drupal blocks are present, and give a class depending on how many blocks are available.
<?php if($page['sidebar_first'] || $page['sidebar_second']) {
$contentwid= "eleven";
} else {
$contentwid= "sixteen";
} ?>
<?php if($page['sidebar_first'] && $page['sidebar_second']) {
$contentwid= "seventeen";
} else {
$contentwid= "sixteen";
} ?>
<div id="content" class="<?php print $contentwid; ?> columns">
</div>
The second statement works fine, If there is a block in the first sidebar AND a block in the second sidebar, then the main content has a class of seventeen.
The problem is with the first statement for OR ( || ). It doesn't matter if there is a block in either sidebar, the content is always given a class of sixteen, which is full width, and pushes the sidebar content to the bottom.
I know its detecting sidebar blocks correctly because the second statement works perfectly. I have set up everything else correctly, and have traced it back to this OR statement, which always seems to result in FALSE (sixteen).
I've tried || and OR, but as far as I know, they are no different, just user preference right?
I'm stumped.