Limit search result using Search Block

Permalink 1 user found helpful
Hey I just want to know how can I limit the number of results per page on Search block.

I would like to limit my result to 10 or any other number per page.

I keep on following the code but I cant find the limit on queries.

Is there an easier way to do this.

Thanks.

zurcxer
 
jordanlev replied on at Permalink Reply
jordanlev
The search block paginates to 20 results-per-page. To change this, copy this file:
SITEROOT/concrete/blocks/search/controller.php

...to here:
SITEROOT/blocks/search/controller.php

(you'll probably need to create the /blocks/search/ directory first).

Now edit that new copy of the file and find this line of code (it's down near the bottom):
$res = $ipl->getPage();

...and directly ABOVE that line add this new line of code:
$ipl->setItemsPerPage(10);

You can change that number 10 to whatever you want.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.