I have searched high and low but couldn't find answer to this. Is there a way to expand the advanced search by default, when user opens the "xxx.com/search/node" page? I gather many users tend to miss the collapsible advanced search form thus they were not able to set the search parameters.

Thanks in advance if you can shed some light in this. Cheers!

Dean Loh

Comments

tdimg’s picture

There are two themable functions available:

- theme_search_block_form (more info: http://api.drupal.org/api/file/modules/search/search.module/5)
- theme_search_theme_form (more info: http://api.drupal.org/api/file/modules/search/search.module/5)

Some info here: http://api.drupal.org/api/group/search/5

Here are some snippets:

function phptemplate_search_theme_form($form) {
	/**
	* This snippet catches the default searchbox and looks for
	* search-theme-form.tpl.php file in the same folder
	* which has the new layout.
	*/
	return _phptemplate_callback('search-box', array('form' => $form));
}

since the above snippet looks for search-box.tpl.php here is a very simple one:

<label for="edit-search_theme_form_keys">Search</label> <input type="text" maxlength="128" name="edit[search_theme_form_keys]" id="edit-search_theme_form_keys" size="25" value="" title="Enter the terms you wish to search for." class="form-text" /> 
<input type="submit" name="op" value="go" class="submit" />
<input type="hidden" name="edit[form_id]" id="edit-search-theme-form" value="search_theme_form" />
<input type="hidden" name="edit[form_token]" id="edit-search-theme-form-token" value="<?php print drupal_get_token('search_theme_form'); ?>" />

I found those in one of my own themes, I am pretty confident that I found them originally somewhere here but don't know where and a search didn't reveal it.

kiev1.org’s picture

in drupal 5.7 does not work - there are not results in a search, in transition on a next page the report of "Validation shoots out error, please try again. If this error persists, please contact the site administrator.", but if comment function phptemplate_search_theme_form($form) - all ok (((
please help!
my search-box.tpl.php:

 <input maxlength="128" name="search_theme_form_keys" id="edit-search-theme-form-keys" size="15" value="" title="Search" class="form-text" type="text">
<input name="op" value="Search" class="form-submit" type="image" src="themes/fdir/p/krug.gif" alt="" />
<input name="form_token" id="edit-search-theme-form-form-token" value="<?php print drupal_get_token('search_form'); ?>" type="hidden">
<input name="form_id" id="edit-search-theme-form" value="search_theme_form" type="hidden">

hardly found that suddenly, on some oddity in drupale 5th suddenly so it happened that it is now necessary to write not drupal_get_token('search_form') and drupal_get_token('search_theme_form') ...

picxelplay’s picture

$form['advanced']['#collapsed']=FALSE;

----
Sudo Kill Cylons

dianacastillo’s picture

Hi, Where can I put this code so it wont be in the core? In Drupal 6

thank you,
Diana

Diana Castillo

dianacastillo’s picture

I made a module which keeps advanced search uncollapsed, you can download it here http://drupal.org/node/715634#comment-6713270

Diana Castillo