0

我正在修改 Bartik 以创建自定义主题。从我读过的所有内容来看,我做对了,但它仍然无法正常工作。我已经清除了我的缓存一百万次,但仍然出现这些错误:

注意:未定义索引:include() 中的 department_column_left(/Users/scott/Sites/HardwareNext/sites/all/themes/hn01/templates/page.tpl.php 的第 191 行)。注意:未定义索引:include() 中的 department_content(/Users/scott/Sites/HardwareNext/sites/all/themes/hn01/templates/page.tpl.php 的第 197 行)。注意:未定义索引:include() 中的 department_footer(/Users/scott/Sites/HardwareNext/sites/all/themes/hn01/templates/page.tpl.php 的第 203 行)。

任何帮助将不胜感激!

这是hn01.info文件:

name = hn01
description = HN - Template 01
package = Core
version = VERSION
core = 7.x

stylesheets[all][] = css/layout.css
stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css
stylesheets[print][] = css/print.css

regions[header] = Header
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom

regions[featured] = Featured
regions[content] = Content
regions[sidebar_first] = Sidebar first

regions[department_column_left] = Department column left
regions[department_content] = Department content
regions[department_footer] = Department footer

regions[footer_firstcolumn] = Footer first column
regions[footer_secondcolumn] = Footer second column
regions[footer_thirdcolumn] = Footer third column
regions[footer_fourthcolumn] = Footer fourth column
regions[footer] = Footer

settings[shortcut_module_link] = 0


; Information added by drupal.org packaging script on 2012-11-07
version = "7.17"
project = "drupal"
datestamp = "1352325357"

...这是page.tpl.php文件中的相关代码:

<?php if ($page['department_column_left']): ?>
  <div id="department-column-left" class="department-column-left"><div class="section">
    <?php print render($page['department_column_left']); ?>
  </div></div> <!-- /.section, /#department-column-left -->
<?php endif; ?> 

<?php if ($page['department_content']): ?>
  <div id="department-content" class="department-content"><div class="section">
    <?php print render($page['department_content']); ?>
  </div></div> <!-- /.section, /#department-content -->
<?php endif; ?> 

<?php if ($page['department_footer']): ?>
  <div id="department-footer" class="department-footer"><div class="section">
    <?php print render($page['department_footer']); ?>
  </div></div> <!-- /.section, /#department-footer -->
<?php endif; ?>

如果有什么我可以澄清的,请告诉我。我认为添加区域就像添加到 .info 文件然后修改page.tpl.php文件一样简单。还有更多吗?

提前感谢,

斯科特。

4

1 回答 1

0

好吧,这很奇怪。

正如我所说,多次清除缓存后,我关闭浏览器并重新打开它。那并没有解决问题。

因此,当我在“流程”上等待答案时,我开始在管理菜单中导航。转到“配置”并调整图像样式,然后在我更新后...

上面的错误就消失了。

我的新区域已就位且可用。我整个早上都在使用它们,没有任何不良影响。所以如果你遇到我的问题——在你把那只鸡献给 Drupal 之神之前——试着进入一个街区,改变一些东西,然后保存它。它只是可以将您的键盘从该死的鸡中拯救出来。

于 2013-01-19T18:13:59.737 回答