在Druapl 中有關自定義regions,
使用panels 等等
有關將一個頁面分割為不同的部份,
以方便管理的技術, 這裡都有介紹過
但也因為有這兩種方法
我自己也一直想不通,
什麼時候使用panels, 什麼時候使用regions
後來, 為了效能的問題, >Read more
在Druapl 中有關自定義regions,
使用panels 等等
有關將一個頁面分割為不同的部份,
以方便管理的技術, 這裡都有介紹過
但也因為有這兩種方法
我自己也一直想不通,
什麼時候使用panels, 什麼時候使用regions
後來, 為了效能的問題, >Read more
D6 update: Region 的定義在 .info 之內, 以下內容只適用於 D5 (2010-03-10)
新的模版有一個比較特別的地方,
就是自定了三個位於頁尾的regions,
而沒有使用panels.
當然, 第一是效能的考慮,
二來, 因為每一頁都會有這三個頁尾區
製作眾多panels 只費時失事
增加regions是theme 的管轄範圍
初初我也感到意外, 但為了保持彈性和可定製性
留在theme 的層面也是相當的合理
定製也只需要初階的編程能力
一般的模版開發者是可以應付得來的
在template.php 之內, 定義一個函數:
<?php
function mytheme_regions(){
return array(
'right' => t('right sidebar'),
'content' => t('content'),
'header' => t('header'),
'footer' => t('footer'),
'bottom_left' => t('bottom left'),
'bottom_center' => t('bottom center'),
'bottom_right' => t('bottom right'),
);
}
?>//page.tpl.php
<?php if ( $bottom_left || $bottom_center || $bottom_right || $feed_icons ):?>
......
Recent comments
3 days 1 hour ago
3 days 3 hours ago
3 days 6 hours ago
3 days 6 hours ago
4 days 14 hours ago
1 week 18 hours ago
1 week 2 days ago
1 week 5 days ago
2 weeks 23 hours ago
2 weeks 23 hours ago