Templates 使用钩子菜单的Drupal 7自定义模板
我试图在Drupal7中使用这些钩子来创建自定义页面模板,但当我在浏览器中打开时,它会显示空白页面。这是我的密码Templates 使用钩子菜单的Drupal 7自定义模板,templates,drupal,drupal-7,hook-menu,hook-theme,Templates,Drupal,Drupal 7,Hook Menu,Hook Theme,我试图在Drupal7中使用这些钩子来创建自定义页面模板,但当我在浏览器中打开时,它会显示空白页面。这是我的密码 /* Implements hook_menu(); */ function story_menu () { $items['story/filters'] = array( 'title' => 'Search For stories', 'page callback' => 'story_filter_page',
/*
Implements hook_menu();
*/
function story_menu ()
{
$items['story/filters'] = array(
'title' => 'Search For stories',
'page callback' => 'story_filter_page',
'access arguments' => array('access content'),
);
return $items;
}
// Implements Page Callback
function story_filter_page ()
{
return theme('story_search_filter_page', array('title' => 'Testing'));
}
/*
Implements hook_theme();
*/
function story_theme($existing, $type, $theme, $path)
{
return array(
'story_search_filter_page' => array(
'variables' => array('title' => NULL),
'template' => 'custom-page',
),
);
}
我已经在我的模块目录中创建了模板文件:custom-page.tpl.php。我已经找到了页面显示为空白的原因。基本上,story是我的内容类型,所以在我的主题中有一个tpl文件名:页面--story.tpl.php,而该文件是空的。。这就是为什么我的页面显示空白屏幕。这似乎是正确的。您可以共享日志吗?从哪里可以找到日志?在
/admin/reports/dblog
中,您已经清除了菜单缓存,对吗?日志是空的。是的,我已经清除了我的缓存很多次了。有没有其他方法来调试这个?