Change number of search results per page?

Regular Contributor

I've cloned the search results module to repurpose, all is fine I only have one last little tweak I can't seem to figure out.


I have a 3 column results page but the search result pages pulll 10 results per page. This is annoyign is I don't have an even 3x3 grid. I'd like to reduce the results pp to 9 but can't see how I would do this.


At first I thought changing the


function getLimit() {
  return parseInt(params.get('limit'));

To have a static integer would work but didn't seem to have an effect.

1 Reply
HubSpot Moderator

Hi @benji_thecroc,


I believe you can do this by just adjusting the search URL. There's a function httpRequest() that sets a variable:


var SEARCH_URL = "/_hcms/search?"


The CMS site search works basically the same way as the http API, documented here: There's an optional query parameter for limit. So if you wanted to continue searching only the current domain using that default SEARCH_URL variable, you could just add the limit parameter in the query string. I think you'd end up with this:


var SEARCH_URL = "/_hcms/search?limit=9&"


On the other hand if you wanted to search all domains in your portal, you could do something like this:


var SEARCH_URL = "",


Let me know if that'll work for you. But in testing I think this should work for you.


 - Leland