如何将寻呼机放在页面的顶部和底部?
我知道我需要使用 theme_pager 函数来呈现代码:
http://api. drupal.org/api/function/theme_pager/6
我知道它被预先渲染到 page.tpl.php 的 $content 中,如果我想对其进行主题化,我只需要将 theme_pager 函数覆盖到模板.php。
我知道在视图中我只需使用变量 $pager,但我没有使用视图。
我想知道的是我如何简单地自己调用 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>
I know that I need to use theme_pager function to render the code:
http://api.drupal.org/api/function/theme_pager/6
I know that it is pre rendered into the $content of the page.tpl.php and if I would like to theme it I only had to overwrite the theme_pager function into template.php.
I know that in Views I only had to use the variable $pager, but I'm not using Views.
What I want to know is how I could simply call theme_pager passing a variable "items" by myself. Where I can find the "items" of the pager?
EDIT:
There is no "items", the content of the pager is passed globally to the function.
So if you want to add a new pager at the top of your page you only have to call the "theme_pager" function (or yours if you have overwrite it) on the page.tpl.php:
<?php print $content_top; ?>
<?php echo theme('pager', null, 1, 0, array(), 9); ?>
<div id="content-area">
<?php print $content; ?>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不会将
items
传递给theme_pager
。如果您将相同的 id:
$element
传递给该函数,它应该可以与已添加的分页器一起正常工作。You don't pass
items
totheme_pager
.If you pass in the same id:
$element
to the function, it should work fine with the pager that's already is added.