list items per page and pagination

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 15, 2011   (RSS)

By ikanizaj - June 14, 2011

Is it possible to create 20 items per page, but that pagination goes ten records at the time.

What I would like is to create first ten items displaying title, images, summary, etc. and next ten items only title.

Then I would like, when I click on next page, to display ten items (from the first page that had only titles) with title, images, summary, and next ten items with only titles? Is that possible?
--
Igor Kani¾aj

Re: [ikanizaj] list items per page and pagination

By Jason - June 14, 2011

Hi Igor,

So to clarify, one your first page, you want to display 20 items, and then you want to display 10 items on each page after. Is that right?

One options would be, instead of using perPage, use the limit and offset options.

For example, if $_REQUEST['page'] = 1 or has no value, you would use:
offset => 0,
limit => 20

If the page is greater than 1, you would use
offset => $page * 10,
limit => 10,

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] list items per page and pagination

By ikanizaj - June 14, 2011

no no, 20 items on every page. First ten with more detail, and other ten with just title. But on second page, first ten with more detail should be the one that were just title on previous page.
--
Igor Kani¾aj