Hi everyone.
I'm doing a little up on this message because I'm trying to create a custom pagination myself, and I'm encountering some unexpected issues.
I tried to use the context object for pagination which I though could mix the pro of both AdamN solutions.+ I wanred to allow the user to arrive directly to any page they want by passing it in the url (which can't be done with the Ajax method).
So, I tried something like that :
<!-- nombre de thread -->
<#assign thread_count = rest("boards/id/${cat_id}/threads/count").value/>
<!-- nombre d'item par page -->
<#assign itemPerPage = 6/>
<!-- page courante (par default 1 ) -->
<#if webuisupport.path.parameters.name.get("page")??>
<#assign page_number = webuisupport.path.parameters.name.get("page") />
<#else>
<#assign page_number = 1 />
</#if>
<!-- Instanciation pagination -->
<#assign pageable_item = webuisupport.paging.pageableItem
.setCurrentPageNumber(page_number)
.setItemsPerPage(itemPerPage)
.setTotalItems(thread_count?number)
.setPagingMode("enumerated")
.build />
<!-- REST requête avec les paramètres au dessus -->
<#assign thread_list = rest("boards/id/${cat_id}/threads?restapi.response_style=view&page_size=${itemPerPage}&page=${page_number}")/>
So I though that using the default link in the pagination item, and the page parameter to create different rest request each time I change page
It worked fine on dev server, but on production where we have a lot of thread, I see than I can't go through every page.
For exemple, I have a board with 129 entry, so logically I've got 22 pages in my pagination item. It works fine until page 5, but I can't go over this page. I can click page 6, 17 or 22 it will always send me back to page 5.
What's more weird is that I tried page 6, 17 and 22 directly in the rest request, and It works fine.
So I don't have a clue whi I'm stuck here.
Can somebody help me ?
Thanks,
niten