php - 创建新主题后出现 Drupal 错误, undefined variable : hide_site_name and other similar error

标签 php drupal drupal-7 drupal-theming drupal-themes

我是 drupal 主题的新手。我创建了一个目录 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).

经过google搜索,发现清除缓存即可解决问题。但即使在清除我的缓存之后,它仍然是一样的!

最佳答案

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

在你的page.tpl.php中:

$page['footer_firstcolumn'];

在您主题的 .info 中:

regions[footer_firstcolumn] = Footer first column

重新检查所有区域后,不要忘记刷新缓存

关于php - 创建新主题后出现 Drupal 错误, undefined variable : hide_site_name and other similar error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11611842/

相关文章:

php - Drupal 分层菜单主题

php - 从 ActionScript 3 到 MySQL 的 ByteArray -> 通过 ZendAMF 的 PHP

php - 如何在nusoap中通过引用设置参数?

php - Zend Framework 用另一个 div 替换 div

php - 用jquery返回json数据?

css - 从最近的内容 block 中删除用户名 Drupal 7

Drupal Views2 公开表单

php - Drupal团队管理

javascript - Location.href 调用了两次

php - 在drupal中检测数据库连接类型