将自定义区域添加到HTML5_base主题(Drupal)

时间:2010-12-22 03:08:40

标签: php drupal-6 themes

我是创建自定义主题的新手。我正在尝试添加自定义区域。我正在尝试创建的自定义区域称为“顶栏”。 在 .info文件

regions[header] = Header
regions[content_top] = Content top
regions[content_bottom] = Content bottom
regions[sidebar_first] = First sidebar
regions[sidebar_second] = Second sidebar
regions[footer_region] = Footer
regions[top_bars] = Top Bars
page.tpl.php 文件中的

<?php if ($top_bars): ?>

<?php print $top_bars ?>

<?php endif; ?>

我也启用了Devel模块并尝试清除缓存。

我也试过在 page.tpl.php 文件中写这个:

<div id="top_bars">
        <?php print $top_bars ?>
</div>

1 个答案:

答案 0 :(得分:0)

查看此博客post

基本上,这个人必须将此添加到他的 template.php

function theme_preprocess_node(&$variables) {
    $variables['cool_node_region'] = theme('blocks', 'cool_node_region');
}