我只是試圖創建一個模塊名稱mymodule
,並試圖將主題應用於drupal6中的該模塊。如何在drupal6中創建自定義主題並將模板應用到它
我已經爲我的模塊添加了.info文件,並在我的主題文件夾中創建了mymodule.tpl.php
文件,並從管理員啓用了該模塊。但是當我通過url訪問模塊時,它會返回白頁。
我mymodule.module.php文件包含
function mymodule_menu() {
$items = array();
$items['mymodule'] = array(
'page callback' => 'mymodule_page',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function mymodule_page() {
$result = db_query('SELECT * from node');
return theme('mymodule', array('output' => $result));
}
function mymodule_theme() {
$content = array(
'custom' => array(
'arguments' => array('output' => 'NULL'),
'template' => path_to_theme() . '/mymodule',
'path' => '/'
),
);
return $content;
}
我不知道爲什麼主題不會應用到我的模塊。請幫忙。
它工作的感謝.. – anoop
很高興我可以幫助! :) – endorama
Yah它爲我工作。目前我只能在page.tpl.php的內容區域查看此內容。我如何更改整個模板的主題?這個問題,我已經在這裏添加http://stackoverflow.com/questions/16609463/how-can-i-change-the-entire-template-of-the-page-according-to-module-in-drupal6 – anoop