标题中的块不会出现在 drupal 中
我通过 sitebuilding->block->addblock 添加了一个包含一些信息的块
,并选择其区域作为标题,
但是这个块没有显示在标题中......有什么想法吗?
我使用的是drupal6
page.tpl.php的代码如下
<div id="header">
<div id="header_logo">
<?php if (isset($secondary_links)) : ?>
<div id="secondary-menu">
<?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?>
</div>
<?php endif; ?>
<?php
// Prepare header
$site_fields = array();
if ($site_name) {
$site_fields[] = check_plain($site_name);
}
if ($site_slogan) {
$site_fields[] = check_plain($site_slogan);
}
$site_title = implode(' ', $site_fields);
if ($site_fields) {
$site_fields[0] = '<span>'. $site_fields[0] .'</span>';
}
$site_html = implode(' ', $site_fields);
if ($logo || $site_title) {
print '<h1><a href="'. check_url($front_page) .'" title="'. $site_title .'">';
if ($logo) {
print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" />';
}
print $site_html .'</a></h1>';
}
?>
</div>
<div id="primary-menu">
<?php if (isset($primary_links)) : ?>
<?php print $primary_links_tree; ?>
<?php endif; ?>
</div>
</div>
<!-- end header -->
i added a block with some information through sitebuilding->block->addblock
and selected its region as header
But this block doesn't displays in header....any idea?
I am using drupal6
The code of page.tpl.php is as follows
<div id="header">
<div id="header_logo">
<?php if (isset($secondary_links)) : ?>
<div id="secondary-menu">
<?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?>
</div>
<?php endif; ?>
<?php
// Prepare header
$site_fields = array();
if ($site_name) {
$site_fields[] = check_plain($site_name);
}
if ($site_slogan) {
$site_fields[] = check_plain($site_slogan);
}
$site_title = implode(' ', $site_fields);
if ($site_fields) {
$site_fields[0] = '<span>'. $site_fields[0] .'</span>';
}
$site_html = implode(' ', $site_fields);
if ($logo || $site_title) {
print '<h1><a href="'. check_url($front_page) .'" title="'. $site_title .'">';
if ($logo) {
print '<img src="'. check_url($logo) .'" alt="'. $site_title .'" id="logo" />';
}
print $site_html .'</a></h1>';
}
?>
</div>
<div id="primary-menu">
<?php if (isset($primary_links)) : ?>
<?php print $primary_links_tree; ?>
<?php endif; ?>
</div>
</div>
<!-- end header -->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜测 header 是在您的主题 .info 文件中定义的,因为您在块页面中看到它。
但我没有看到您在页面模板中打印标题区域。如果该区域被命名为“header”,那么您需要将其添加到页面模板中的某个位置。
I'm guessing header is defined in your theme .info file since you see it in the block page.
But what I don't see is you printing the header region in the page template. If the region is named 'header', then you need to add this somewhere in your page template.