Interesting that Search Page doesn’t have the %first_asset_position%
and
%last_asset_position%
keywords that Asset Listing Page has .
I think you’re right that you need keyword maths to make it happen, and you need to hardcode the page size which is a shame but probably ok. You’re definitely on the right track, but:
- you need some maths to turn the current page number to the “first index of this page”, and
- Your solution for the end date would show 260 on the last page, not 257, so you need to compare it to
%result_count%
to make sure it doesn’t go over.
This seems to work
%current_result_page^subtract:1^multiply:20^add:1% - %current_result_page^multiply:20^gt:{result_count}:{result_count}:{current_result_page^multiply:20}%
The index of the start of the current page is (page - 1) * 20 + 1
.
The index of the end of the current page is page * 20
unless that is larger than result_count
, in which case use result_count
instead.