Jump to:

23455 Posts in 18904 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Change Pagination number

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 168 Views
  • Bagzli
    Avatar
    Community Member
    31 Posts

    Change Pagination number Link to this post

    Hey guys,

    I've tried following this tutorial to get pagination working: http://doc.silverstripe.com/framework/en/howto/pagination

    I've managed to get it to work and it defaults to 10 results per page, however I cannot figure out how to change that number and set it to 3 or 5 or whatever I need. I'm not sure what the code is nor where I would put it.

    Anyone can help?

  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Change Pagination number Link to this post

    This should work:

       public function PaginatedPages() {
          return PaginatedList::create(Page::get(), $this->request)->setPageLength(3);
       }

  • Bagzli
    Avatar
    Community Member
    31 Posts

    Re: Change Pagination number Link to this post

    Thank you, worked like a charm.

    168 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.