Regions

新的模版有一個比較特別的地方,
就是自定了三個位於頁尾的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'),
  );
}
?>

mytheme 是這個theme的名字,
那樣, $bottom_right, $bottom_left, $bottom_center 等的變數就會出現在page.tpl.php 之內
你可以將它們放到自定的位置, div 之內
//page.tpl.php
<?php if ( $bottom_left || $bottom_center || $bottom_right || $feed_icons ):?>
......

到 admin->site building->blocks 就會看到有'bottom left' 等等的選項了

Comments

设计得不错

设计得不错

還需要該CSS嗎? 我用不

還需要該CSS嗎?
我用不出來..請教一下

要 region


region 只會定義一個區給你方便的管理, 排版的整潔
你還是要用css 放好region 到你想要的地方

能在具体些吗?JOE大

能在具体些吗?JOE大大。我好象弄不出来。

麻烦举个例子。(就是具体到哪个文件改怎么改代码)

joe... 你好...你的这一

joe...
你好...你的这一篇文章偶转载了..

原来都没有转载的..但是因为这几次访问过来..偶这儿都有一点慢..
倒还不知道是为什么.

为了方便因为我把它转载到我的网站上..
http://www.evance.name/node/636

如果有不方便的地方...请告诉我.我马上把它删除..

:)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h4> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options