I am have trouble using the PaginatedPages. In the docs, it's possible to customize the summary.
There is my code :
public function PaginatedPages($n = 10) {
$list = Page::get()->sort(array('Date' => DESC));
$Pages = new PaginatedList($list, $this->request);
if ($_GET['results'] != "") {
$n = $_GET['results'];
}
$Pages->setPageLength($n);
return $Pages;
}
The pagination in the bottom of the template page :
<div id="PaginatedPages">
<% if $PaginatedPages.MoreThanOnePage %>
<% if $PaginatedPages.NotFirstPage %>
<a class="prev" href="$PaginatedPages.PrevLink"><</a>
<% end_if %>
<% loop $PaginatedPages.Pages %>
<% if $CurrentBool %>
<a class="current">$PageNum</a>
<% else %>
<% if $Link %>
<a href="$Link">$PageNum</a>
<% else %>
...
<% end_if %>
<% end_if %>
<% end_loop %>
<% if $PaginatedPages.NotLastPage %>
<a class="next" href="$PaginatedPages.NextLink">></a>
<% end_if %>
<% end_if %>
</div>
This code reproduces:
[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20]
I don't want this. If a have 20 pages of results, it will show all and the result is to long and ugly.
I want the following:
[1] ... [9] [10] [11] [12] [13] ... [20]