Is there a simple way to accomplish the feature in the title ? When a search results in one result, don't show the result but go directly to the node.


As I see the only way is use hook menu alter for this item

 * Implements hook_menu().
function search_menu() {
  $items['search'] = array(
    'title' => 'Search',
    'page callback' => 'search_view',
    'access callback' => 'search_is_active',
    'type' => MENU_SUGGESTED_ITEM,
    'file' => 'search.pages.inc',

I propose to replace page callback "search_view" to your own and put there your logic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.