Pagination not working on niche pages

Post Reply
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Pagination not working on niche pages

Post by ivan »

Hi.

Pagination and TOTAL_ITEMS doesn't work correctly at niche pages showing incorrect number of galleries. On one site it is too small, like 3-4 galleries, on another one shows more than 100k records, while site contains of one thousand only.

What can cause this problem ?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Pagination not working on niche pages

Post by admin »

Hi,

what script tags do you have in your template?
I mean <thumb and so on
Don't forget to run script update
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Re: Pagination not working on niche pages

Post by ivan »

<thumb num=1-6>
...
</thumb>
<thumb num=7-100>
...
</thumb>
<pagination skip_href_deletion=true first_pages=4 adjustment=2 last_pages=3 active_link_style=btn-alt>
...
</pagination>
<trader num=1-6>
...
</trader>
<trader num=7-18>
...
</trader>



For debug purposes i put <!--TOTAL_ITEMS--> in the top of the template, it shows 35 only while having 2532 galleries in this niche
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Re: Pagination not working on niche pages

Post by ivan »

content_search template with the same tags works fine
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Pagination not working on niche pages

Post by admin »

are you 100% sure you don't have any other tags?
like <thumb search_log ?

create test template with

<!--TOTAL_ITEMS-->

<thumb num=1-6>
...
</thumb>

<pagination skip_href_deletion=true first_pages=4 adjustment=2 last_pages=3 active_link_style=btn-alt>
...
</pagination>


open as /?force_template=test&category_name=...
Don't forget to run script update
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Re: Pagination not working on niche pages

Post by ivan »

Yes, you are right. At the bottom i have also

<thumb search_log=all num=1-200 order=hits filter=GET_GROUP_NAME>
...
</thumb>
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Re: Pagination not working on niche pages

Post by ivan »

After removing it everything works fine, but i want to keep related searches here.
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Pagination not working on niche pages

Post by admin »

You need either to use page_main_tag or <search_log tag

https://smartcj.com/wiki/doku.php?id=ru ... _templates

otherwise the script decides that the tag that has higher num is the main tag at the page
Don't forget to run script update
ivan
Posts: 10
Joined: Sat Oct 02, 2021 4:17 pm

Re: Pagination not working on niche pages

Post by ivan »

Thanks! That was the reason.
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Pagination not working on niche pages

Post by admin »

NP )
Don't forget to run script update
Post Reply