hi ,
i just want to hide my search block from my search result pages ..

Comments

kuldip zala’s picture

hi,

Try to hide using css.

Thanks,

vijaythummar’s picture

Instead of css use hook_form_alter in your module.

Thanks,
Vijay Thummar

valderama’s picture

this one works (for drupal 7)

function mymodule_form_alter(&$form, &$form_state, $form_id) {
    if( $form_id == 'search_form' )
      $form = array();
}

--

keine zeit für spielkonsolen mein leben ist jump n run!

valderama.net

jebeze_alexander’s picture

This didn't work for me as a theme hook, but did work when I replaced

$form = array()

with

$form['#access'] = FALSE;

prakashp’s picture

If you are using the 'Search form' block, you could 'configure' this block on the 'admin/build/block' page.
In the 'Page specific visibility settings',
Select 'Show on every page except the listed pages.'
In the Pages textarea enter the follwoing :

search/*

This should hide the search block on the search result pages.

Prakash

yorkshire-pudding’s picture

Use Path rule in a new context
~search/*
and add the block in the desired region. Will show on all pages except the search pages.
Import this context if you prefer and just adjust the region and weight to suit your needs.

$context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
$context->api_version = 3;
$context->name = 'search';
$context->description = 'Show search bar on every page except search pages';
$context->tag = 'site';
$context->conditions = array(
  'path' => array(
    'values' => array(
      '~search/*' => '~search/*',
    ),
  ),
);
$context->reactions = array(
  'block' => array(
    'blocks' => array(
      'search-form' => array(
        'module' => 'search',
        'delta' => 'form',
        'region' => 'secondary_content',
        'weight' => '-10',
      ),
    ),
  ),
);
$context->condition_mode = 0;

// Translatables
// Included for use with string extractors like potx.
t('Show search bar on every page except search pages');
t('site');