我正在修改 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文件一样简单。还有更多吗?
提前感谢,
斯科特。