I've set up a gallery page that uses "gallery" template. The gallery page will contain lots of images but I want to display only 20 per page. How can I accomplish pagination for this type of action?
I don't want to set up children pages that will contain 20 images per page, rather let the Processwire do the pagination from one page.
I've not tried seddass's solution, but it looks right on. I'm using some of his code in my example too. So here's another option, which is to piggyback onto the MarkupPagerNav module, even though you aren't dealing with pages.
// get the images you are going to display
$items_per_page = 4;
$start = ($input->pageNum - 1) * $items_per_page;
$total = count($page->images);
$images = $page->images->slice($start, $items_per_page);
// make this to give MarkupPagerNav what it ne