Drupal 为前台(Front page)页面添加区域(Regions)
生活随笔
收集整理的這篇文章主要介紹了
Drupal 为前台(Front page)页面添加区域(Regions)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
實(shí)在不知道剛剛接觸DP,應(yīng)該從哪里看起了,就在官方文檔中看到哪里就記錄哪里吧
假設(shè)主題為 mytheme:
1、themes/mytheme/template.php(如果不存在的話,直接創(chuàng)建這個(gè)文件就可以了),定義區(qū)域如下:
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、創(chuàng)建區(qū)域后,就需要在前臺(tái)頁面中顯示,找開 page.tpl.php(沒有話直接創(chuàng)建)
3、其它區(qū)域也是這樣添加就可以了?
4、為這些區(qū)域添加區(qū)塊(blocks) Administer > Site Building > Blocks
5、如果不想在前臺(tái)頁面中顯示默認(rèn)的內(nèi)容的話可以增加if判斷,如
if(!$is_front) print $content;總結(jié)
以上是生活随笔為你收集整理的Drupal 为前台(Front page)页面添加区域(Regions)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Drupal 使用 Views 模块时,
- 下一篇: Drupal 覆写系统样式