Page 1 of 1
Pagination not working on niche pages
Posted: Sat Oct 02, 2021 4:24 pm
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 ?
Re: Pagination not working on niche pages
Posted: Sat Oct 02, 2021 4:32 pm
by admin
Hi,
what script tags do you have in your template?
I mean <thumb and so on
Re: Pagination not working on niche pages
Posted: Sat Oct 02, 2021 4:41 pm
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
Re: Pagination not working on niche pages
Posted: Sat Oct 02, 2021 4:42 pm
by ivan
content_search template with the same tags works fine
Re: Pagination not working on niche pages
Posted: Sat Oct 02, 2021 5:09 pm
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=...
Re: Pagination not working on niche pages
Posted: Mon Oct 04, 2021 7:41 am
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>
Re: Pagination not working on niche pages
Posted: Mon Oct 04, 2021 7:44 am
by ivan
After removing it everything works fine, but i want to keep related searches here.
Re: Pagination not working on niche pages
Posted: Mon Oct 04, 2021 8:05 am
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
Re: Pagination not working on niche pages
Posted: Mon Oct 04, 2021 8:38 am
by ivan
Thanks! That was the reason.
Re: Pagination not working on niche pages
Posted: Mon Oct 04, 2021 12:26 pm
by admin
NP )