作者:老葛,北京亚艾元软件有限责任公司,http://www.yaiyuan.com
$content: 这个区域的内容,通常为区块。
$classes: 包含CSS类的字符串。可以通过修改预处理函数中的$classes_array变量来修改这里的值。它的默认值有region,region-[name],注意“[name]”中的下划线将自动替代为连字符,比如page_top区域,其中对应的一个类为region-page-top。
$region:区域变量的名字,定义在主题的.info文件中。
$classes_array: CSS类的数组,$classes变量的值基于$classes_array生成。
在这个模板中,还可以使用的通用变量有: $is_admin、$is_front、$logged_in。
对应的预处理函数:
template_preprocess()
template_preprocess_region()
template_process()
作者:老葛,北京亚艾元软件有限责任公司,http://www.yaiyuan.com
它的模板建议规则,是按照区域名字来定义的。我们还以right区域为例,它的模板建议为:
region--right.tpl.php
region.tpl.php
Drupal自带的默认region.tpl.php模板文件,位于modules\system目录下面,内容如下:
<?php if ($content): ?>
<div class="<?php print $classes; ?>">
<?php print $content; ?>
</div>
<?php endif; ?>