Site Search pagination not working
4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 13, 2014 (RSS)
By sublmnl - June 17, 2014
Hi guys, found the post from 2013 on the site search and it works flawlessly except one thing.
The pagination is not working.
It simply reloads the same page of results. Even after you go 'next' and 'previous' the number links to page results do not change pages.
A little help would be awesome. For now I have increased the results per page to give the users more results until I can get this fixed.
At least the 'next' link works :-)
I'm talking about this:
http://www.interactivetools.com/forum/forum-posts.php?site-search-78768
Specifically this Search set up:
http://www.interactivetools.com/forum/forum-posts.php?postNum=2230147#post2230147
By claire - June 17, 2014
Hey there
Can you email me the code for that page? It's claire@interactivetools.com. I'll see if I can spot the issue.
Claire Ryan
interactivetools.com
Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
By sublmnl - July 13, 2014
Just so everyone has it, the pagination code that works is here:
The part that needed editing from those examples is in the a href (link code).
<?php if (@!$_GET['page']): $current_page = "1"; else: $current_page = $_GET['page']; endif; ?>
<?php foreach (range(1,$searchDetails['totalPages']) as $page): ?>
<?php if ($page == $current_page): ?>
<strong><?php echo $page; ?></strong>
<?php else: ?>
<a href="search.php?q=<?php echo $_REQUEST['q']; ?>&page=<?php echo $page; ?>"><?php echo $page; ?></a>
<?php endif ?>
<?php endforeach; ?>