Question: I'm currently hacking the [Advanced Testimonial Manager](https://www.magentocommerce.com/magento-connect/advanced-testimonial-manager.html) plugin to achieve what I need on the website I'm working on. It's a pretty good module but I required pagination rather than all testimonials being dumped onto one page:

```
public function __construct()
{
  parent::__construct();
  $collection = Mage::getModel('testimonialmanager/testimonialmanager')->getCollection();
  $this->setCollection($collection);
}

protected function _prepareLayout()
  {
    parent::_prepareLayout();
    $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
    $pager->setAvailableLimit(array(10=>10,20=>20,'all'=>'all'));
    $pager->setCollection($this->getCollection());
    $this->setChild('pager', $pager);
    $this->getCollection()->load();
    return $this;
}

public function getPagerHtml()
{
    return $this->getChildHtml('pager');
}

protected function _getCollection()
{
  $collection = Mage::getModel("testimonialmanager/testimonialmanager")->getCollection()
  ->addFieldToFilter('status', '2')
  ->setOrder('testimonial_id', 'DESC')
  ->load();
  return $collection;
}

```

This doesn't sort the collection by testimonial ID. If I revert the code back to the original (without the pagination toolbar), it does sort correctly. Any help would be greatly appreciated!

Answer: 
if you are adding only you must add this function as `public`

```
public function _getCollection()
{
     $limit        =    10
        $curr_page    =    1;

        if(Mage::app()->getRequest()->getParam('p'))
        {
            $curr_page    =    Mage::app()->getRequest()->getParam('p');
        }
         if(Mage::app()->getRequest()->getParam('limit'))
        {
            $limit    =    Mage::app()->getRequest()->getParam('limit');
        }
        //Calculate Offset    
        $offset     =    ($curr_page - 1) * $limit;
      $collection =  Mage::getModel("testimonialmanager/testimonialmanager")->getCollection(    )
      ->addFieldToFilter('status', '2')
      ->setOrder('testimonial_id', 'DESC')
      $collection->getSelect()->limit($limit,$offset);
  return $collection;
}

```

now in phtml call `<?php $this->_getCollection(); ?>`
Not absolutelly sure, but maybe you have to change line 

```
$pager->setCollection($this->getCollection());

```

to 

```
$pager->setCollection($this->_getCollection());

```

?