1

我的主题中有下面的代码来检测该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
4

1 回答 1

1

只是检查<?php if($leftsidebar): ?>。然后添加所有标记。

于 2012-02-07T20:53:14.397 回答