<
 
 
 
 
×
>
Vous consultez une page Web conservée, recueillie par Bibliothèque et Archives Canada le 2006-11-24 à 06:10:23. Il se peut que les informations sur cette page Web soient obsolètes, et que les liens hypertextes externes, les formulaires web, les boîtes de recherche et les éléments technologiques dynamiques ne fonctionnent pas. Pour toutes les demandes ou pour recevoir du soutien, envoyez un courriel à archivesweb-webarchives@bac-lac.gc.ca. Voir toutes les versions de cette page conservée.
Chargement des informations sur les médias

You are viewing a preserved web page, collected by Library and Archives Canada on 2006-11-24 at 06:10:23. The information on this web page may be out of date and external links, forms, search boxes and dynamic technology elements may not function. For all requests or for support, email archivesweb-webarchives@bac-lac.gc.ca. See all versions of this preserved page.
Loading media information
X
Skip Navigation
PrintPrint version

Update Search Code

Replacing the Microsoft search engine code with new Google search engine code

This is intended for anyone using the Microsoft search engine for a custom "search this site" type search box on their site. These search boxes use HTML form code similar to the Service Nova Scotia site. The old code for searching in the Microsoft search engine must be edited to work with the new Google search engine.

The new Google search engine became active in November 2002. You will need update your search box code to use the Google engine.

To update your code, you will need to find all instances of the old Microsoft search box code on your site and replace it with the new code. If you made changes to the old code, such as renaming the Search button from "Search" to something else, or replacing the search button with a graphic, or changing the size of the search box, you'll need to make the same changes to the new code. Follow these steps to update the code on your site. Please use the graphic "FormGo1.gif" for the search button.

Example of old Microsoft search engine code:

<form action="/search/query.asp" method="post">
<input type="hidden" name="Scope" value="/yourdirectory">
<INPUT maxLength=100 name=SearchString size="20">
<INPUT name=Action type=submit value=Search>
</FORM>

  1. Find an instance of the code as it currently appears on your site and copy select everything from the beginning of the form tag (<FORM>) up to and including the end form tag (</FORM>).

  2. Paste that into a new document.

  3. Select and copy the new Google code as it appears below and paste it below the code you pasted in Step 2





  4. Make the following edits to the new code:

    1. <input type="hidden" name="site" value="your_collection"/>

      Replace "your_collection" with a collection that corresponds to your search domain(s).

      What is my collection?

      What if I can't find a collection which contains domain(s) that I wish to have searched?

    2. <input type="hidden" name="client" value="your_frontend"/>

      <input type="hidden" name="proxystylesheet" value="your_frontend"/>

      Replace "your_frontend" with a frontend that corresponds to your department or agency.

      What is my my frontend?

    3. If you changed the size of the search box, change the values in the new code

    4. If you changed the label on the Search button or replaced the button with a graphic, change that information in the new code.

    5. Save this file as an instance of the new code, customized for your site.

    6. Search and replace all instances of the old code in all the files on your site with the new code you just created.

    7. Upload the new files to the web server.

We have provided instructions in the Google Developer Kit on how to add your own header and footer to the search results page to customize it to suit your site. Click here to download the Google Developer Kit.

Example of new Google search code:

<form action="http://www.gov.ns.ca/snsmr/gsa2.asp" method="get" name="question">
<input class="inputtext" name="q" size="20" maxlength="255" value="Search">
<!-- you may add an image for search button but do not change name="btnG"!!! -->
<input type="submit" name="btnG" value="Search">
<input type="hidden" name="site" value="your_collection"/>
<input type="hidden" name="client" value="your_frontend"/>
<input type="hidden" name="proxystylesheet" value="your_frontend"/>
<input type="hidden" name="output" value="xml_no_dtd"/>
</form>