I am wanting to include a larger than normal 'next page' type button in the list.phtml template whilst still having the normal pagination from pager.phtml
The function I'm wanting to use is found in code/core/Mage/Page/Block/Html/Pager.php:
public function getNextPageUrl()
{
return $this->getPageUrl($this->getCollection()->getCurPage(+1));
}
This can be called in pager.phtml by performing $this->getNextPageUrl(). I'm wanting to call this function inside list.phtml but I'm not sure how to get it. Using $this->getNextPageUrl() doesn't work.
I've also tried variations of Mage::getModel('page/html_pager')->getNextPageUrl() without luck.
Best Answer
There are two ways of doing this. One is slightly easier than the other.
Add After
getToolbarHtml
callIf you do it after the call to
getToolbarHtml
in the list.phtml then the following code will work.This is because the pager is actually inside the toolbar and not the list, see layout xml.
And most importantly the collection is setup in the toolbar's
getPagerHtml
function:Add before
getToolbarHtml
callOr if you simply want to put it anywhere in the template what you can do is set the collection using the list`s collection with the following code.