3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1927 Views |
-
navigation in pagination

18 May 2010 at 9:37pm
hi
i have 20 pages with pagination
the default function in documentation http://doc.silverstripe.org/private:recipes:pagination get all page number in the list<< prev 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 next >>
how to modify it to get
1,2,3,4, |5| .... 20 next >>
like in forum ?
what about 100 pages ? ; )
-
Re: navigation in pagination

18 May 2010 at 10:50pm Last edited: 18 May 2010 10:52pm
Hi
Please find the url
http://doc.silverstripe.org/searchcontext
also find below help for slide pagination.
<% if Results.NotFirstPage %>
<a class="prev" href="$Results.PrevLink" title="View the previous page"> « Previous</a>
<% end_if %>
<% control Results.Pages(5) %>
<% if CurrentBool %>
<a href="#" class="current">$PageNum</a>
<% else %>
<a href="$Link" title="View page number $PageNum">$PageNum</a>
<% end_if %>
<% end_control %>
<% if Results.NotLastPage %>
<a class="next" href="$Results.NextLink" title="View the next page"> Next »</a>
<% end_if %>Hope its helps
Regards,
Ram
http://www.agriya.com -
Re: navigation in pagination

19 May 2010 at 4:37am Last edited: 19 May 2010 4:51am
Instead of
<% control Results.Pages(5) %>
you could also use<% control Results.PaginationSummary(5) %>
This would add the first and the last page to the list.[EDIT]
Found the way to add the dots as well - all documented within the DataObjectSet class:<% control ProductList.PaginationSummary(5) %>
<% if CurrentBool %>
<strong>$PageNum</strong>
<% else %>
<% if Link %>
<a href="$Link" title="<% _t('GOTOPAGE', 'Go to') %> $PageNum">
$PageNum
</a>
<% else %>
...
<% end_if %>
<% end_if %>
<% end_control %> -
Re: navigation in pagination

16 June 2010 at 3:22pm
Awesome thanks @martimiz for the information. Works perfect.
Cheers,
Colin
| 1927 Views | ||
|
Page:
1
|
Go to Top |


