PHPTemplate模版引擎是Drupal内置默认的模版引擎,区域(Regions)就象容器,Drupal的区块(block)和一些其他的内容都在区域(Regions)中显示。
在Drupal 5.x默认提供了5个区域(Regions):left 、 right 、content 、header 、footer 。在主题模版 page.tpl.php 文件可以使用$sidebar_left, $sidebar_right, $content, $header, $footer_message这些变量来显示,如:
<?php print $header; ?>
如果想增加一些自定的区域(Regions),可以打开\themes\engines\phptemplate\phptemplate.engine
假设你的主题为:skin1
路径为:\sites\all\themes\skin1
复制下列代码到你的主题template.php,并修改
修改后为
然后就可以把$left_top放在page.tpl.php的合适位置,使用:
接着到 “管理--站点创建--区块”,编辑和新增一个区块就能设置到该区域(Regions)
template.php的修改方法请参考附件:drupal5.x_template.php_.txt
page.tpl.php的修改方法请参考附件:drupal5.x_page.tpl_.php_.txt
如果浏览附件出现乱码,请将网页编码改成UTF-8
| 附件 | 大小 |
|---|---|
| drupal5.x_page.tpl_.php_.txt | 3.73 KB |
| drupal5.x_template.php_.txt | 2.72 KB |
最新评论
3 周 3 天之前
6 周 4 天之前
15 周 3 天之前
15 周 4 天之前