Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

How do I set up a custom search box for an IU web site?

You can add a search box to your Indiana University web site to help visitors find information on your site. You can restrict the search to a specified directory, or search the entire IU web site. When a visitor enters a search term and clicks Search, the page will leave your site and display the search results in a formatted page. To add a search box to your page:

  1. Insert the following HTML into your web page where you want the search box to appear: <form method='get' action='http://search2.iu.edu/search'> <input type='text' name='q' size='32' maxlength='255' value=''/> <input type='submit' name='btnG' value='Search'/> <input type='hidden' name='site' value='indiana'/> <input type='hidden' name='client' value='indiana'/> <input type='hidden' name='proxystylesheet' value='indiana'/> <input type='hidden' name='output' value='xml_no_dtd'/> <input type='hidden' name='as_dt' value='i'/> <input type='hidden' name='as_sitesearch' value='<yoururl>'/> </form>

    Note: If you have been using the Ultraseek (Verity) search feature on your page, be sure to replace the complete Ultraseek HTML section of your page with the complete Google HTML section above.

  2. Customize the following parameters:

    • name='q' size='32' : Sets the width (in number of characters) of the search box. You can change the size to suit your site's layout, but don't change the maxlength value.

    • name='btnG' value='Search' : The text that appears on the search button (e.g., Search School of Medicine Site).

  3. Customize the stylesheet parameter. There are two stylesheets available for the display of search results:

    • name='proxystylesheet' value='indiana'  : This is the default stylesheet, as specified in the HTML above. This stylesheet includes a menu of defined subcollections.

    • name='proxystylesheet' value='http://search.iu.edu/stylesheet.xslt' : This stylesheet, from the main IU search site, does not include the subcollections menu, but does include a people search option and navigation to the IU directories and A-Z Index.

  4. If you want to restrict your search feature to a specific directory (and its subdirectories), include the following two parameters: as_dt and as_sitesearch . If you want the search feature on your site to search the entire IU collection, remove these two parameters from your HTML. If you include these parameters, customize them as follows:

    • name='as_dt' value='i' : Determines whether your search should include or exclude the directory specified in 'as_sitesearch' . Values can be:

      • 'i' (include only results in the web directory specified by as_sitesearch)
      • 'e' (exclude all results in the web directory specified by as_sitesearch)

    • name='as_sitesearch' value='<yoururl>' : Pages in the specified directory will be included in or excluded from your search (according to the value of 'as_dt'). For example: name='as_sitesearch' value='cs.indiana.edu'

      Note the following:

      • You must specify the complete canonical name of the host server followed by the path of the directory (e.g., www.iu.edu/services , not www/services ).

      • If the  /  (forward slash) character is at the end of the web directory path specified, then only files within that directory will be searched and files in subdirectories will not be considered (e.g., www.iu.edu/services will include subdirectories, while www.iu.edu/services/ will exclude subdirectories).

      • The parameter as_sitesearch allows you to specify one directory (and all its subdirectories) as the domain to be searched; you cannot specify multiple disparate directories using this option.

      • If you want the search feature on your site to search the entire IU web site, delete this parameter.

For more detailed information on search parameters, see Search Parameters on Google's Search Protocol Reference page.

This is document atch in domain all.
Last modified on September 28, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.