coder1.com

  • home
  • drupal articles
  • contact
Home

Drupal do_search

Drupal do_search limit is hard coded to 10 - Here's a work-around

Mike Milano — January 23, 2009 - 2:57pm

Recently I had to implement a custom search function using Drupal's do_search() function. I needed to display many more results than 10, which is hard coded in the function.

The simple solution was this:

1. Go to http://api.drupal.org/api/function/do_search/6 (make sure you get the function for the correct version of Drupal you are using)

2. Copy the function and rename it to something like do_search_custom.

3. Add a parameter called $limit and make it default to 10. ( $limit=10 )

4. Replace pager_query argument at the bottom of the function with $limit.

  • Drupal do_search
  • 1 comment
Syndicate content

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact