2010-02-12 59 views
0

现在,我的博客文章被生成为我主要内容区域中的节点。在我的内容区块中,只有一个区块,这是为了博客导航,它需要在博客文章的顶部,它有非常自定义的标记 - 我怎么能扭转顺序?我不确定在哪里移动这些帖子。重新排列博客帖子与内容块的排序?

澄清:我需要我的区块才显示在主页上,博客文章位于哪里,我需要它显示在博文以上。

回答

1

上市页遗憾的是,并不是通过图形管理界面完成此操作的简单方法,因此您可能必须进入主题代码才能进行此更改。海事组织,最简单的方法是定义一个新的块区域。

如果您使用的是贡献/核心主题,则可能需要定义当前主题的子主题以进行更改。有关子主题的更多信息,请参阅http://drupal.org/node/225125

要创建新的块区域,你需要将它添加到你的主题.info文件


name = My Theme 
description = Example 
core = 6.x 
engine = phptemplate 

regions[left] = Left Sidebar 
regions[right] = Right Sidebar 
regions[content] = Content 
regions[header] = Header 
regions[footer] = Footer 
regions[above_content] = Above content 

在这里,除了默认的区域(左,右,内容,页眉,页脚)时,主题有一个名为above_content的自定义区域。

然后,编辑您的主题的page.tpl.php文件,并将$above_content变量添加到将显示在内容上方的模板中。例如,如果你延长加兰主题,您可以添加$above_content变量,像这样:

... 
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner"> 
      <?php print $breadcrumb; ?> 
      <?php if ($mission): print '<div id="mission">'. $mission .'</div>'; endif; ?> 
      <?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?> 
      <?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?> 
      <?php if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif; ?> 
      <?php if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif; ?> 
      <?php if ($show_messages && $messages): print $messages; endif; ?> 
      <?php print $help; ?> 
      <div class="clear-block"> 
      <?php print $above_content ?> 
      <?php print $content ?> 
      </div> 
      <?php print $feed_icons ?> 
      <div id="footer"><?php print $footer_message . $footer ?></div> 
     </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center --> 
... 

然后,您可以将块添加到块管理页面上的“以上内容”区域,并将其设置为只显示在首页。

0

您可以控制它的设置块的知名度在三个方面:

  • PHP语句
  • 在所有页面上,除了上市
  • 只有在
+0

对不起,我还希望它在博客文章上方。碰巧知道该怎么做? – 2010-02-12 11:35:05

+0

只是列出您想要显示的页面。 – googletorp 2010-02-12 12:03:56