Search Code For Municipalities
Basic "Search this Site" Code
To add a basic "search this site" form to your site, you need only add the following form code to your site with a few modifications.
- First, copy the following code and paste it into a blank HTML document.
- Next, make the following edits to these lines of the code:
- <input type="hidden" name="site" id="site" value="your_collection">
<input type="hidden" name="r" id="r" value="your_collection" />
Replace "your_collection" with the collection corresponding to your site. To find the collection corresponding to your site, please click "What is my collection?"
E.g.: If your site or domain is "www.town.amherst.ns.ca" then your collection would be "NSMUN_AMHERST"
-
<input type="hidden" name="h" id="h" value="your_domain" />
Replace "your_domain" with the URL of your site. Please note: if your site is using a virtual domain (e.g.: museums.gov.ns.ca), use your virtual domain here.
Do not add a trailing slash (colored in red in the example below) after the URL.
E.g.: www.town.amherst.ns.ca/
If you do, Google will limit its search to just the files in the root of your site and so files in subdirectories of your site will not be found.
- <input type="hidden" name="i" id="i" value="your_header_image" />
Replace "your_header_image" with a name of an image that you will use as a header for the top of your page. This image must reside on the root of your directory; it may not be kept in an images folder or any other folder off the root.
E.g.: "askjoehowe2750.jpg" - This is the name of the image header at the top of this page.
- <input type="hidden" name="t" id="t" value="your_header_image_height" />
Replace "your_header_image_height" with the height of "your_header_image" (as described above).
E.g.: "750" - This is the width of the image header (askjoehowe2750.jpg) at the top of this page.
- <input type="hidden" name="w" id="w" value="your_header_image_width" />
Replace "your_header_image_width" with the width of "your_header_image" (as described above).
E.g.: "50" - This is the height of the image header (askjoehowe2750.jpg) at the top of this page.
- <input type="hidden" name="site" id="site" value="your_collection">
- Additional (optional) edits you can and cannot make:
- You can change the size of the search input box (it defaults to "40.")
- You can add an image for the search button, but do not change
the name="btnG" parameter.
- You can use a table to control the layout of the form, but do
not break up the form into separate tables or the code will not work.
- You can use style sheets to control the layout of the form (recommended
over using tables)
- You can change the size of the search input box (it defaults to "40.")
- Upload your form code and test it out. Search results should be within your site.
