2013-10-04 43 views
0

嗨,我正在使用一個修改的bartik主題,我想更改身體。如何覆蓋bartik中的html.tlp.php文件

我一直在試圖改變它使用以下變化,因爲這是大多數的文檔。說要做,但它不起作用。

function bartik_preprocess_html(&$variables) { 
    $variables['theme_hook_suggestions'][] = 'html__node__7'; 

任何想法?

回答

2

在你bartik theme文件夾中有一個名爲function。但bartik_process_page(&$variables)我不得不說,嘗試複製您的themesites/themes文件夾,如果你要改變或者改變任何theme .Inside此​​功能的地方$variables['theme_hook_suggestions'][]並指定所需的tpl.php file您purpose.For例如

function bartik_process_page(&$variables) { 

    $variables['theme_hook_suggestions'][] = 'html__test'; //Place your code here 

我有一個在我的bartik folder.Try清除cache和運行名爲html--test.tpl.php文件。 :)

+0

我試過這個,它不工作。也許不使用分主題與它有關。我知道這不是最好的做法,但不管它是否工作?我已成功重寫page.tpl.php但html.tpl.php沒有這樣的運氣。 –

+0

謝謝,是的,這工作,但只有在我創建自己的subtheme後。 –