Pedro Posada | Place Pager at top and bottom of Views view.

Place Pager at top and bottom of Views view.

Posted on August 5, 2008 - 12:44am
<< 30 of 50 >>

This code helps you place the pager at top and bottom of your views.

Copy and paste this code into your template.php file.

<?php
function phptemplate_views_view($view, $type, $nodes, $level = NULL, $args = NULL){
   
$output = '';
    if (
$view->use_pager) {
       
$output .= theme('pager', '', $view->pager_limit, $view->use_pager - 1);
    }

   
$output .= theme_views_view($view, $type, $nodes, $level = NULL, $args = NULL);

    return
$output;
}
?>

Tested in drupal 4.x and 5.x

Submitted by Anonymous (not verified) on August 29, 2008 - 3:21pm.

Thanks. That worked nicely in my 5.9 install. I cross posted here: http://drupal.org/node/263587#comment-985874

Submitted by mroswell (not verified) on January 25, 2009 - 9:00pm.

This works a charm. But I'm curious why theme('views_view',...) doesn't seem to work. For instance, given the way theme functions are usually called, shouldn't this work?

theme('views_view', $view, $type, $nodes, $level = NULL, $args = NULL);

It doesn't... but why not?

Post new comment

The content of this field is kept private and will not be shown publicly.
Please solve the math question. This way we will know you are not a robot.