Webguide Home | Search
New York University

Web Site Development

Adding A Search to Your Site > Using the NYU Search Results Style Sheet

Using the NYU Search Results Style Sheet

To use the default NYU search results style, you will need to add the following code into the HTML file where you want the search box to be displayed. You will need to specify the site URL to search. For this example, we will use the NYU Webguide URL, www.nyu.edu/webguide, as the site to search.

<form method="get" action="http://google.nyu.edu/search">
<input type="hidden" name="site" value="NYUWeb_Main" />
<input type="hidden" name="client" value="NYUWeb_Main" />
<input type="hidden" name="output" value="xml_no_dtd" />
<input type="hidden" name="proxyreload" value="1" />
<input type="hidden" name="proxystylesheet" value="NYUWeb_v50_Main" />

<!-- here is where you add your URL -->
<input type="hidden" name="sitesearch" value="www.nyu.edu/webguide" />

<input size="20" name=q value="" />
<input type="submit" value="Search" />
</form>

To ensure that your site is properly searched, make sure that the sitesearch variable (the Web address without the http:// prefix) is not followed by a trailing slash.

The code above will produce the following search box:

Type a word in the search box above (for example, email) and click the "Search" button to view the results page. The search results style sheet used is the default NYU style. You do not need to create any additional files to use this style sheet.