I would like to display a pager at the end of a teaser list of nodes in a block, but that option doesn't seem to exist. Nor is there a way to hook into the view build to enable a pager.

This patch just makes some small modifications so that you could use a custom module to hook into the views (using pre_query hook) that need a pager. I imagine it'd take quite a bit more work to allow it to be settable in the admin, so maybe something like this would be good enough for the time being?

CommentFileSizeAuthor
views.module_30.patch1.6 KBsarvab
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Needs review » Fixed

When I first read this issue, I was a little dubious. Then I looked at the patch and saw what it actually does.

I'm very much pro putting variables on the $view object itself so that they can be used; one of the weaknesses of my original design was not giving the $view *enough* of the view, so to speak. So moving things there is a good idea, IMO.

I modified it just slightly; because existing documentation has $limit and $offset being available in the php_args and I don't want to break existing code, I moved the bits that set $view->use_pager to *after* the php_arg code is run; that shouldn't have any negative effects since php_arg code can directly modify the variables before they get set on the $view anyhow.

Applied to 4.7.x and 5.x

Anonymous’s picture

Status: Fixed » Closed (fixed)