创建新主题后的Drupal错误,未定义变量:hide_site_name和其他类似错误

Nit*_*ish 2 php drupal drupal-7 drupal-themes drupal-theming

我是drupal主题的新手.我创建了一个direcory mytheme并添加mytheme.info到它并从drupal的默认主题目录中复制了其他文件.编辑后page.tpl.php,drupal显示下面的错误.

Notice: Undefined variable: hide_site_name in include() (line 99 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined variable: hide_site_name in include() (line 109 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: featured in include() (line 168 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: highlighted in include() (line 187 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: sidebar_second in include() (line 212 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_first in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_middle in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: triptych_last in include() (line 220 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: footer_firstcolumn in include() (line 230 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: footer_secondcolumn in include() (line 230 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: footer_thirdcolumn in include() (line 230 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Notice: Undefined index: footer_fourthcolumn in include() (line 230 of C:\wamp\www\dtest\sites\all\themes\mytheme\bartik\templates\page.tpl.php).
Run Code Online (Sandbox Code Playgroud)

在谷歌搜索后,我发现清除缓存将解决问题.但即使清除了我的缓存,它仍然是一样的!

Muh*_*eda 6

通常,当您在page.tpl.php文件中调用主题.info文件中不存在的区域时会发生这些错误.

在你的page.tpl.php:

$page['footer_firstcolumn'];
Run Code Online (Sandbox Code Playgroud)

在你的主题中.info:

regions[footer_firstcolumn] = Footer first column
Run Code Online (Sandbox Code Playgroud)

重新检查所有地区后,不要忘记flush the cache.