I need to theme views pager, but I can't find the way to do it. For example - Instead of printing 'last page' I need print the last page number. I tried to use Drupal's theme_pager with the pager array from the 'view' object, but it returns an empty string.



Solved :) - Following Change views pager programmatically .

Example code: (In hook_views__pre_render)

if( !empty($view->query->pager->options) ) {
  $last_page = ceil($view->query->pager->total_items / $view->query->pager->options['items_per_page']);
  $view->query->pager->options['tags']['last'] = $last_page;

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.