Skip to content | Change text size
 

Search form customisation

There are two options when setting up a search customisation:

  1. creating a simple search box to redirect users to the search engine
  2. creating a "virtualisation" of the search engine on your site, so users see results with your branding.

Simple search form

This is suitable for sites that use the default Monash branding. To create your own search form that restricts searches to only your part of the Monash web:

  1. Save a copy of the search box form or copy it from webedit:/web/its/staff/web/guides/searchbox.html or on the CMS from /default/main/prod/its/staff/WORKAREA/main/its/staff/web/guides/searchbox.html. (Right click, select "Save file as"). Note that, by way of example, the search box is configured to search the Faculty of Arts web site.
  2. Copy the text, in its entirety, into your web page.
  3. Find the line that contains name="site" value="www.arts.monash.edu.au" and change the URL specified to the base URL for your area. For example, if you want to customise the search to search the Law web site, the line should read name="site" value="www.law.monash.edu.au".
  4. Save and upload your page.

Branding search results

We have created an example setup for branding search results with your site's brand. The first step is to download the PHP script and index.html files. Create your search directory and copy them:

On webedit:

mkdir search
cd search
cp /web/its/staff/web/guides/branded-index.html ./index.html
cp /web/its/staff/web/guides/branded-search.php ./search.php

On the CMS:

mkdir search
cd search
cp /default/main/prod/its/staff/WORKAREA/main/its/staff/web/guides/branded-index.html ./index.html
cp /default/main/prod/its/staff/WORKAREA/main/its/staff/web/guides/branded-search.php ./search.php

Once you have done so you will need to make some modifications to them:

  1. Set the ACTION_PATH definition to where you would like your branded search to appear to run from. The default should be fine for most people. Note that it is not the search.php script!
  2. Define the values to appear in your $siteSearchOptions array.
  3. Define the values to appear in your $siteSearchNames array. This is similar to defining an ALIASDIR in the breadcrumb configuration; the name is what appears in a <select> that allows users to narrrow/expand their search.
  4. Create the directory referred to in your ACTION_PATH, and put the search.php in there.
  5. Verify that the PHP script is working by visiting your search script. With no variables, the search engine will spit back the empty search form. The form's action will be what you have specified in ACTION_PATH - verify that this is correct.
  6. Create the index.html file to put in the search directory, or modify the example provided. This file is what appears to run the search; it calls the search.php script which in turn communicates with the search engine. Modify the content to suit your branding.
    (Using this as a separate file means we can use Apache to collect the SSIs etc, which is easier than using PHP.)
  7. Update your header files to point searches at your new search directory.
  8. You may need to create or edit an htaccess file in the search directory to tell Apache to parse the PHP script. The directive to use is
    AddType application/x-httpd-php .php

You should now be away! Please contact us if you have further problems. If you have difficulty following these instructions, also let us know; we can then make these modifications for you and send you the code you need.

If yours is a new web site, the search engine may not yet have indexed it. It will be picked up in the next weekly run, or if it is critical that it be indexed as soon as possible, contact us to arrange or a special index run of your site.