By mediumgrade on
I want to configure the search module to paginate the search results so that it only shows 10 results per page. How can this be done?
Thanks,
I want to configure the search module to paginate the search results so that it only shows 10 results per page. How can this be done?
Thanks,
Comments
=-=
There is no reason to post multiple threads asking the same question. If you don't receive an answer in 12 - 24 hours, bump the original post.
I've removed the other threads.
From what I can see, the search.module does limit to 10 results per page.
what version of Drupal is in use?
Version 5. Do I have to
Version 5. Do I have to change the module directly?
How does one "bump" the original post?
=-=
version 5 point what?
again, you state you want the search to show only 10 results and then be paginated, From what I can see on drupal.org it looks to me to already show 10 results with pagination.
how many results is your site showing?
I am not saying to hack the search.module, I am trying to clarify your question and insure we aren't chasing our tail here.
My Apologies. Drupal 5.5. If
My Apologies. Drupal 5.5.
If I wanted to change the number of results shown before pagination (say, 5 results, then paginate), where would I go?
=-=
I believe the above function is what handles this in the search.module
That being said, I believe you can add this to your template.php and change the function name to YOURTHEME_search_page as per http://drupal.org/node/55126
Then you can change the integer 10 to 5.
That being said, I've not tested this, so do so on a test site.
Actually, that wasn't
Actually, that wasn't it.
The line of code needing to be edited is in the search.module file on line 871 (in search module version 1.209.2.5)
I simply changed the 10 to the desired number. The theme_pager function simply outputs some HTML to make the paging links at the bottom of the search results.
Now, while this works, I don't like having to edit the search module to do it. Is there a way for me to override the query? Is this something I should suggest for a future version of this module?
=-=
you may be able to override with hook_form_alter, I've not tested it.
as far as features for a future version, if a patch was created that added this to the admin area under search settings and allowed variables to be set, I'd be all for it.
drupal 6
How to override the pagination number in drupal-6.13
Search results pagination in Drupal 6.x
No one knows ?
I am lookin for changes in pagination results number and pagination templating in drupal 6.x