1

I'd like to relocate the pager generated by views and put it, in my page.tpl.php part, in order to display it at the very bottom of the page.

Is this possible?

I tried copying this code from a view to page.tpl.php but it didn't work:

  <?php if ($pager): ?>
    <?php print $pager; ?>
  <?php endif; ?>
2

Copying this code snippet into your page.tpl.php won't help because the $page variable will not be defined for this template. You can only move it freely inside the views-view.tpl.php template.

You can add a similar $pager variable to your page template using your theme or module's implementation of hook_preprocess_page(). In this implementation, you can retrieve the current page's view (if any) using views_get_current_view(). See the template_preprocess_views_view() function in Views' include/theme.inc for how to generate the pager from a view object. In Views 3.x the pager is build by the query plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.