Jump to:

23471 Posts in 18937 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Pagination too long

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: 304 Views
  • Bagzli
    Avatar
    Community Member
    31 Posts

    Pagination too long Link to this post

    Hey guys,

    I was wondering is there a public guide or code that somebody did before that would show how to shorten my pagination? I am using the pagination that tutorials recommend however I have 30 pages of news and it lists 1-30, it doesn't look good. I'm looking a way to make it so that it shows 1 2 3 ...18 19 [20] 21 22 ... 30

    And if I were to click on 22 then it would show 1 2 3 ... 20 21 [22] 23 24 ... 30. This is fairly coming in websites, just wondering if there is another version to pagination that is shown in tutorials. I've been researching but could not find anything.

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: Pagination too long Link to this post

    You want to loop over PaginationSummary instead of Pages. See the api docs for an example of how to use them (you need to click on the cell to see all the contents of it).

  • Bagzli
    Avatar
    Community Member
    31 Posts

    Re: Pagination too long Link to this post

    Thank you, that worked.

    304 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.