我的主题中有下面的代码来检测该leftsidebar
区域是否有块。leftsidebar
问题是该 HTML 代码仍然在该区域中没有块的页面上得到输出。我完全不知道问题是什么。我对其他块执行相同的代码并且它可以工作。
这是我的 page.tpl.php 文件中的代码...
<?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; ?>
这是我的 .info 文件中的块区域...
regions[leftsidebar] = Left Sidebar