How to turn on search results pagination?
Permalink
I see some stuff in the view template and the controller... What do I need to do to activate it?
Ok...
starting at line 134 of search block's controller:
Just in case someone else gets stuck with this!
starting at line 134 of search block's controller:
if( is_array($_REQUEST['search_paths']) ){ foreach($_REQUEST['search_paths'] as $path) { //if(!strlen($path)) continue; $ipl->addSearchPath($path); //set items per page for pagination $ipl->setItemsPerPage(4); } }
Just in case someone else gets stuck with this!
I think it's on by default, however, I could be incorrect.
If it's on by default, then perhaps all i need to do is edit the number of results displayed, but I can't find this variable either... Can't override helpers/pagination.php, which seems like it's playing some role here.
The goofy design I've been given only has space for about five results...
concrete/config/base.php:
# Default search size
define('SEARCH_CHUNK_SIZE','20'); /* number of entries retrieved per page */
# Default search size
define('SEARCH_CHUNK_SIZE','20'); /* number of entries retrieved per page */
I have the same issue - did you manage to resolve it in the end?
My answer I marked as the solution worked, but that was many c5 versions ago.
I would try setting the global SEARCH_CHUNK_SIZE as suggested by msglueck first.
I would try setting the global SEARCH_CHUNK_SIZE as suggested by msglueck first.
Yeah I tried that but it had no effect :(
Have you tried the solution I marked as the answer?
It's pretty old, but you should look for the lines indicated.
The key for me was:
It's pretty old, but you should look for the lines indicated.
The key for me was:
$ipl->setItemsPerPage(4);
Hi There,
I am looking how to solve the same problem as yours: SEARCH_CHUNK_SIZE = 20 or 30 items!!! How to get it?
Best Regards
MAck
I am looking how to solve the same problem as yours: SEARCH_CHUNK_SIZE = 20 or 30 items!!! How to get it?
Best Regards
MAck
I suppose I could try to adapt the pagination script that was posted for the page list block before that functionality was built-in, but that just seems silly as there's clearly some code in the search block intended for pagination.
But I'm afraid my php skills aren't up to snuff to figure out what's going on what's up with this bit from the controller:
Or this bit from the view:
I've scoured the helpers, models, libraries, api and forums for mention of $paginator or a getPages() function, but nothing... I'm clearly missing something simple, but...
Anyone? How can I hand this code the necessary to generate the pagination controls?
Thank you.