Jump to content

Recommended Posts

Posted

Hi All,

Is there a simple way to add a pagination page limit or total item count limit  to a pagination? 

It's for a recipe site (latest recipes) where I would like to limit the total item count to say 24 or 4 paginated pages of 6 items.

Code is as follows ($page->latest set to 6)

$items = $pages->find("template=recipe, limit=$page->latest, sort=-modified");

$pagination = $items->renderPager();

  foreach ($items as $item) {

display recipe..etc...

}

 

 
I tried truncating the $items array but to no avail.
 
cheers,
Ivo
Posted

You can fake the PageArray, that the pagination is based on. 

$pa = new PageArray();
$pa->setTotal($total)->setLimit($limit)->setStart($start);
$pager = $this->modules->get('MarkupPagerNav');
$pagination = $pager->render($pa);
  • Like 4

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...