We currently have a quote page which lists all existing quotes that we would like to show the pager.
We have the following code in the List page which we\'ve added t
We can implement custom model collection with magento pagination by extending Mage_Catalog_Block_Product_List
class in our block class. Suppose I want to display users blog posts with pagination. Here is the steps to implement it easily:
Create a block class (posts.php) and add the below code in it.
class Blog_User_Block_Posts extends Mage_Catalog_Block_Product_List
{
protected function _beforeToHtml()
{
$toolbar = $this->getToolbarBlock();
$collection = $this->_getPostsCollection();
$toolbar->setCollection($collection); /*(Add toolbar to collection)*/
return parent::_beforeToHtml();
}
}
In the view.phptml
file add the below code in it
<?php echo $this->getToolbarHtml() ?>