2010-04-01 33 views
1

我注意到在Zen主題中有各種PHP文件,擴展名爲.inc,文件擴展名爲.i.e。 template.conditional-styles.inc。我讀過/看過不少主題教程,但他們都沒有提到這些文件的主題,只有template.php。主題時使用.inc文件

任何人都可以告訴我什麼時候該如何以及如何使用這些文件進行主題化。

非常感謝

回答

1

它是內部使用禪主題,閱讀評論的文件,請什麼這些。
例如,關於template.conditional-styles.inc

//的用於條件 樣式表代碼開始了作爲用於 禪貼劑。現在
//已經紡 出自己獨立的模塊,它 將是很好的防止禪實施 和 conditional_styles.module之間
//代碼 漂移,
//所以 禪現在包括的 conditonal_style模塊的精確副本:
// conditional_styles.theme.inc,1.4版 2008年9月14日二十三時26分47秒johnalbin精通

它將包含在template.theme-registry.inc文件,通過這個代碼:

function _zen_theme(&$existing, $type, $theme, $path) { 
    // Compute the conditional stylesheets. 
    if (!module_exists('conditional_styles')) { 
    include_once './' . drupal_get_path('theme', 'zen') . '/template.conditional-styles.inc'; 
    // _conditional_styles_theme() only needs to be run once. 
    if ($theme == 'zen') { 
     _conditional_styles_theme($existing, $type, $theme, $path); 
    } 
    } 

_zen_theme將包含在的template.php

/** 
* Implements HOOK_theme(). 
*/ 
function zen_theme(&$existing, $type, $theme, $path) { 
    ... 
    include_once './' . drupal_get_path('theme', 'zen') . '/template.theme-registry.inc'; 

閱讀hook_theme

+0

謝謝Nikit。我已經閱讀了文件中的評論,但我仍然不清楚這裏的問題。我會閱讀你列出的hook_theme鏈接。 非常感謝 – screenm0nkey 2010-04-01 11:59:06