Search Block: Change number of results per page in Search Results

David ReederBy David Reeder, 14 October 2024

You can change the number of results per page in the search results that are generated by the Search block.  Imagine you want 18 results per page

  1. Create a custom controller, by copying the file \concrete\blocks\search\controller.php to \application\blocks\search\controller.php
  2. Update the namespace at the top.  Change it from namespace Concrete\Block\Search; to namespace Application\Block\Search;
  3. Find this line: $pagination = $ipl->getPagination();
  4. After it add a new line with: $pagination->setMaxPerPage(18);
  5. When you perform a search, if there are more than 18 results you will see 18 on page one of the search results.

Back