Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates 使用钩子菜单的Drupal 7自定义模板_Templates_Drupal_Drupal 7_Hook Menu_Hook Theme - Fatal编程技术网

Templates 使用钩子菜单的Drupal 7自定义模板

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',

我试图在Drupal7中使用这些钩子来创建自定义页面模板,但当我在浏览器中打开时,它会显示空白页面。这是我的密码

/*
    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
中,您已经清除了菜单缓存,对吗?日志是空的。是的,我已经清除了我的缓存很多次了。有没有其他方法来调试这个?