Site search

The menu area on the left side of each website may contain a site specific search box. Up to November 2014, ANU used Funnelback for site specific searches. From December 2014, ANU switched to using Google Search Appliance for searching, and sites may need to be reconfigured to use the new search tools.

search box layout

Use of a search box is optional, but if included it must be the first item in the menu area.

The search should search only your website. If you use the standard PHP template, this search box can be activated within the config file.

Search box code

The code for the menu search box is as follows. Note that you need to replace 'Site abbreviation' and 'Your Site Name' with your details in a few places. See the section below for how to find your site name.


<div class="search-box">
    <p>Search Site abbreviation</p>
    <form action="http://find.anu.edu.au/search" method="get">
    <div>

    <input type="hidden" name="client" value="anu_frontend">
    <input type="hidden" name="proxystylesheet" value="anu_frontend">
    <input type="hidden" name="site" value="default_collection">
    <input type="hidden" name="filter" value="0">
    <input type="hidden" name="dnavs" value="inmeta:gsaentity_sitetype=Your Site Name" />
    <input type="hidden" name="q" value="inmeta:gsaentity_sitetype=Your Site Name" />
    <input type="hidden" name="output" value="xml_no_dtd" />
   
    <label for="local-query"><span class="nodisplay">Search query</span></label><input class="search-query" name="as_q" id="local-query" size="15" type="text" value="" />
    <label for="search"><span class="nodisplay">Search</span></label><input class="search-button" id="search" title="Search" type="submit" value="GO" />
    </div>
    </form>
</div>
 
For version 4 sites, you will also need code for the search box in responsive mode. Note that you need to replace 'Your Site Name' with your details in two places.

<div class="search-form">
    <form action="http://find.anu.edu.au/search" method="get">
   
    <input type="hidden" name="client" value="anu_frontend">
    <input type="hidden" name="proxystylesheet" value="anu_frontend">
    <input type="hidden" name="site" value="default_collection">
    <input type="hidden" name="filter" value="0">
    <input type="hidden" name="dnavs" value="inmeta:gsaentity_sitetype=Your Site Name" />
    <input type="hidden" name="q" value="inmeta:gsaentity_sitetype=Your Site Name" />
    <input type="hidden" name="output" value="xml_no_dtd" />
   
   
    <label for="local-query-mini">Search site</label> <input class="search-query" name="as_q" id="local-query-mini" size="15" type="text" value="" />
    <label for="search-mini"><span class="nodisplay">search</span></label><input class="search-button" id="search-mini" title="Search" type="submit" value="GO" />
    </form>
</div>
   

Finding your site name

Finding your site name on find.anu.edu.au

The Google search appliance has a list of ANU sites for which it will create a site specific search. To do a search on your site, you will need to know the site name that Google uses, and put that into your search code in several places.

To find your site name, go to http://find.anu.edu.au and do a search for something that you would expect to find on your site. In the results, click on the box labelled "Site" and find your site name. This is the name that the Google system uses to restrict results to your website - use that in the search box code above.

If your site name has spaces in it, you will need to replace them with '%20'. Likewise, brackets will need to be replaced with % codes: '(' should be '%28', and ')' should be '%29'.

e.g. if your site search name is "ANU Awesome (AA)" then you should use "ANU%20Awesome%20%28AA%29" in your code.

Any new sites will have to be added to the search system by the webstyle team. If you can't find your site name, or have a new site, contact us and we will be able to help.

Updating PHP templates

If you have used an older version of the ANU PHP templates to build your site, you should update your code to the latest version. Version 4.14 of the templates includes new code in the config.php file to do a site search using the Google system.

You will need to update your settings_site.php file with a new variable, containing your site name. Remember to replace any spaces or brackets with appropriate % characters. e.g.:

$SiteSearchName     = "Your%20site%20name";
   

Updated:  18 August 2017/ Responsible Officer:  Director Marketing/ Page Contact:  Webstyle