【问题标题】:I cannot display the header region in my Drupal theme我无法在我的 Drupal 主题中显示标题区域
【发布时间】:2013-05-29 21:25:14
【问题描述】:

我没有在我的 drupal 主题中看到标题区域的内容是在 page.tpl.php 中使用以下代码的最佳做法吗?

<?php include('region--header.tpl.php'); ?>

使用上面的代码可以看到内容,但是使用下面的代码看不到内容:

<?php if ($page['header']): ?>
  <?php print render($page['header']); ?>
<?php endif; ?>

在我的 .info 文件中,我有以下代码:

regions[header] = Header

【问题讨论】:

    标签: php drupal drupal-theming


    【解决方案1】:

    将您的基本region.tpl.php 文件复制到主题的模板文件夹中。 region--header.tpl.php 文件 region.tpl.php 文件应放在模板文件夹中。

    【讨论】:

    • 如果我知道的话,该区域至少也需要显示一个块,不是吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多