我想總是渲染所有區域。即使它們不包含任何塊。Drupal:強制區域始終呈現?
我使我區像這樣(在page.tpl.php
):
<?php print render($page['region_name']); ?>
下面是我使用的代碼,但這並沒有影響。
function theme_name_page_alter(&$page) {
$regions = system_region_list($GLOBALS['theme'], REGIONS_ALL);
foreach ($regions as $region => $name) {
if(empty($page[$region])) {
$page[$region] = array();
}
}
}
Drupal使用的是什麼版本? – Clive
我使用的是7.2.x版本。 – ndrizza
對於替代答案請參閱:http://drupal.stackexchange.com/questions/33663/force-an-empty-region-to-display-d7 –