您的位置:首页 > 其它

Drupal 为前台(Front page)页面添加区域(Regions)

2015-12-29 11:59 302 查看
实在不知道刚刚接触DP,应该从哪里看起了,就在官方文档中看到哪里就记录哪里吧

假设主题为 mytheme:

1、themes/mytheme/template.php(如果不存在的话,直接创建这个文件就可以了),定义区域如下:

t('left sidebar'),

        'right' => t('right sidebar'),

        'content' => t('content'),

        'header' => t('header'),

        'footer' => t('footer'),

        'frontpage_top' => t('frontpage top'),

        'frontpage_center' => t('frontpage center'),

        'frontpage_bottom' => t('frontpage bottom'),

   );

}

?>


2、创建区域后,就需要在前台页面中显示,找开 page.tpl.php(没有话直接创建)



3、其它区域也是这样添加就可以了

4、为这些区域添加区块(blocks) Administer > Site Building > Blocks

5、如果不想在前台页面中显示默认的内容的话可以增加if判断,如

if(!$is_front) print $content;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: