close

用來依文章類型決定切換模板

if ($node->type == 'eng') {/* check if it's a eng node */
include 'page-eng.tpl.php'; /*load page-eng.tpl.php */
return; }

 

 

page.tpl.php可以用的相關函式 http://api.drupal.org/api/drupal/modules!system!page.tpl.php/6

 

$base_path → 拿還硬塞網頁圖或元件用
$is_front → 判斷是不是在首頁用,用來轉向或不想在首頁出現,但不想再block下過濾的時候用。
$logged_in → 判斷登入

 

放選單:

<?php if (isset($secondary_links)) { ?><?php print theme('links', $secondary_links, array('class' => 'sub', 'id' => 'subnavlist')) ?><?php } ?>

判斷有沒有選單,直接產生ul帶id,li帶class,頭尾自動放入last、first class

 

 

做區塊用的判斷式

<?php if ($login_block): ?> <!-- 登入區塊 -->
        <div id="login">
            <?php print $login_block ?>
        </div>

<?php endif; ?>

 

 

template.php用,在每個頁面加入css及js

drupal_add_css(drupal_get_path('theme', 'theme_name') . '/css/style.css');
drupal_add_js(drupal_get_path('theme', 'theme_name') . '/js/jquery.easing.1.3.js');

 

 

CSS的設定

 

.submitted{ /* 發佈訊息 [ 由 admin 在 日, 03/04/2012 - 16:11 發表  ] 這個  */

 .content{ /*  node主內容區塊 */

.taxonomy{ /* 分類 */

.collapsible{ /* 編輯時的折疊區塊 */

 

.block-region{ /* blcok瀏覽位置的框 */
background:#fff;
border:2px dashed #f00;
color:#333;
filter: alpha(opacity=60);
-moz-opacity:0.6;
opacity:0.6;
}

 

 

 

arrow
arrow
    文章標籤
    drupal drupal6 theme
    全站熱搜

    ezcshi 發表在 痞客邦 留言(0) 人氣()