Basic Search Code Using the Site Search Parameter
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 edit to this line of the code:
-
<input type="hidden" name="sitesearch" value="www.gov.ns.ca/yourdirectory"/>
Replace "www.gov.ns.ca/yourdirectory" 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.: http://www.gov.ns.ca/yourdirectory/
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="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 frontend?
-
<input type="hidden" name="sitesearch" value="www.gov.ns.ca/yourdirectory"/>
- 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)
- See the instructions on customizing
for more.
- 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.
