On the standard Search Form, it would be convenient if it had a link giving the user the option to use the Advance Search Form instead of it only showing after a no result search?

Also work in conjunction with Search Configuration Mod if possible, both have excellent features and almost identical, because when I enabled this Mod, my Result Form with the Advanced search is not initially expanding (Feature of Search Config).

Comments

Vc Developer’s picture

Also the option to hide the Search Form that appears with the Advance Search Form. IMO its not needed. I'm using the default theme with the Search Form in the sidebar and I have three Search Forms on one page. Looks redundant.

grasmash’s picture

I would also appreciate the ability to link a page with the advanced search uncollapsed.

grasmash’s picture

Workaround:

I used the JS Injector module to add this JS to any pages matching "search*" url:

//wait until the rest of the jQuery has been loaded
$(document).ready(function() {
  //break apart url to get anchor
  var url = document.location.toString();
  if (url.match('#')) {
    var anchor = '#' + url.split('#')[1];
  }   
 
  //click collapsed fieldset to expand
  if (anchor == '#advanced-search'){
    $('.search-advanced legend').find('a').click();
  }
});

Just create link to "/search#advanced-search"

mcfilms’s picture

Is this still the best (only?) way to have a stand-alone "Advanced Search" page? You basically have to trick the advanced tab to be revealed by injecting javascript?

heddn’s picture

Status: Active » Fixed

This is an old issue. I'm marking it fixed but if you disagree, please update and provide additional information.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

spidersilk’s picture

To add an advanced search link to the basic search box, make a copy of search-block-form.tpl.php (from the core search module) and put it in with the template files for your theme. Edit it to add:

<div id="adv_search_link"><a href="/search">Advanced Search</a></div>

right before the closing lines:

  <?php } ?>
</div>

Now rebuild your theme registry (there are several ways of doing this - the Flush Caches submenu in the Admin Menu module is the easiest), and voila. You can use the #adv_search_link ID to add styling in your theme's CSS if you like.

It would be nice if this module had that as an option that could be turned on and off, though, for those who may not be comfortable editing template files (though this is a pretty easy edit).

jdanthinne’s picture

Patches are welcome to add this feature…
I'm busy updating the module to D8.

martinma’s picture

Issue summary: View changes

I just still miss this feature too. It would be really great to have an option to have the link to advanced search on default search block.

Unfortunatelly I cant open it again, so I have to create a new one for drupal 8.x ...