【问题标题】:How to put the pager on top and bottom of a page?如何将寻呼机放在页面的顶部和底部?
【发布时间】:2010-08-23 13:18:07
【问题描述】:

我知道我需要使用theme_pager函数来渲染代码:

http://api.drupal.org/api/function/theme_pager/6

我知道它已预先渲染到 page.tpl.php 的 $content 中,如果我想为它设置主题,我只需将 theme_pager 函数覆盖到 template.php 中。

我知道在 Views 中我只需要使用变量 $pager,但我没有使用 Views。

我想知道的是如何简单地调用 theme_pager 并自己传递一个变量“items”。在哪里可以找到寻呼机的“项目”?

编辑:

没有“项目”,寻呼机的内容被全局传递给函数。

所以如果你想在页面顶部添加一个新的分页器,你只需要在 page.tpl.php 上调用“theme_pager”函数(或者你的函数,如果你已经覆盖它):

<?php print $content_top; ?>             

<?php echo theme('pager', null, 1, 0, array(), 9); ?>

<div id="content-area">
    <?php print $content; ?>
</div>

【问题讨论】:

  • 你不应该打电话给theme_pager(...),而应该打电话给theme('pager', ...)

标签: drupal drupal-6 drupal-theming


【解决方案1】:

您不会将items 传递给theme_pager

如果您将相同的 id:$element 传递给函数,它应该可以与已添加的寻呼机一起正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-20
    • 2011-02-11
    • 2022-08-18
    • 2020-10-09
    相关资源
    最近更新 更多