[HOW-TO] Display pager in the top of the node in Drupal 6 with Zen Theme

By BXTra |
I need to display pager for both top and bottom of the node for user to easily to move between pages. The one in the bottom is normally display but I want it to display in the top section also. To do that, Just put the following code :

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

If you want to change the number of pages in the list, just change number 9 to anything you want.

When put that code in page.tpl.php, it will look like below :

        <?php if ($breadcrumb || $title || $tabs || $help || $messages): ?>
          <div id="content-header">
            <?php print $breadcrumb; ?>
            <?php if ($title): ?>
              <h1 class="title"><?php print $title; ?></h1>
            <?php endif; ?>
            <?php print $messages; ?>
            <?php if ($tabs): ?>
              <div class="tabs"><?php print $tabs; ?></div>
            <?php endif; ?>
            <?php print $help; ?>
          </div> <!-- /#content-header -->
        <?php endif; ?>
        <?php echo theme('pager', null, 1, 0, array(), 9); ?>
        <div id="content-area">
          <?php print $content; ?>

        <?php if ($feed_icons): ?>
          <div class="feed-icons"><?php print $feed_icons; ?></div>
        <?php endif; ?>

Tested With :
- Drupal 6.20
- Zen Theme 6.x-1.1
Source :
- http://stackoverflow.com/questions/3547892/how-to-put-the-pager-on-top-and-bottom-of-a-page
- http://api.drupal.org/api/drupal/includes--pager.inc/function/theme_pager/6

Add new comment

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.