Hi,
On a list page, w have the navigation between the pages at the bottom (i.e. << previous page, page 1, page 2, next page >> etc etc).
Is there anyway to limit the number of page X links there are, for example, going from:
<< prev - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 next >>
to
<<prev - 1 - 2 - 3 - 4 - 5 next >>
The code for the page numbers is as follows:
<?php foreach (range(1,$productsMetaData['totalPages']) as $page): ?>
<?php echo $page; ?>
<?php endforeach; ?>
If there is a way to limit the foreach in the above, so you just get 1,2,3,4,5...
The main issue would then be that when you are on page 10 (with page links limited to 5), instead of showing the first 5 pages, it needs to show 5 pages around 10...
i.e.
<<prev 8,9,10,11,12 next >>
You see this idea quite alot around on various sites, for example:
http://www.readitswapit.co.uk/TheLibrary.aspx?CategoryID=-1&CategoryName=All+Fiction&PageID=21&TimeSlot=633685482000003118&BookType=999
You see the page nav has 10 either side of where you are.
Any ideas?
Many thanks in advance
Rob