Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

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

Pagination too long

Go to End

3 Posts   835 Views


Community Member, 71 Posts

19 February 2014 at 11:55am

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.


Community Member, 473 Posts

19 February 2014 at 1:09pm

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


Community Member, 71 Posts

23 February 2014 at 7:01am

Thank you, that worked.