Subcollections & Stylesheets
Overview
Schools and other large organizations may be eligible to define a subcollection in the Google Search Appliance.
A subcollection is a list of URL patterns that can be referred to by a single name, such as "Library". When a search is restricted to the collection called "Library", the query includes only the URL patterns specified in that subcollection's definition.
Defining and using a subcollection requires startup effort from both the Stanford search administrator and the web site developer. If you think you are eligible and want to define a subcollection, complete the steps below.
Note that a new subcollection, or any changes to an existing subcollection, will not take effect until the next scheduled crawl (see the current crawl schedule).
1. Request a subcollection
Submit a request for a subcollection via HelpSU. Include the following information:
- name of the school or organization
- contact person
- the name you want for your subcollection
A subcollection name can be up to 20 characters long and can contain only alphanumerics, underscores, and dashes; the name cannot begin with a dash. - the list of URL patterns you want included in your subcollection
2. Add the subcollection parameter to your search feature's HTML
<form method='get' action='http://find.stanford.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='stanford'/>
<input type='hidden' name='client' value='stanford'/>
<input type='hidden' name='proxystylesheet'
value='stanford'/>
<input type='hidden' name='output' value='xml_no_dtd'/>
<input type='hidden' name='restrict' value='<subcollection_name>'/>
</form>
About the subcollections stylesheet
The subcollections stylesheet has a wider results-list layout than the stylesheet used on the main Stanford search site. It includes a drop-down menu of all the defined subcollections, and does not include a People search option or Stanford-homepage-style navigation to the Stanford Directories and A-Z index.
- When the results page is displayed, the subcollection you specified as the "restrict" value is pre-selected. (If no subcollection was specified, "All documents" is selected.)
- The next search the user types will be restricted to the same subcollection, until the user selects either "All documents" or another subcollection from the menu.
- The default stylesheet always includes the complete, current list of defined subcollections.
- You don't need to change anything in the HTML above to use the default subcollections stylesheet.
Customizing the subcollections stylesheet
Yes, you can customize the subcollections stylesheet to modify the way your search results pages look. Before you decide to do this, be aware that:
- you are not required to customize the subcollections stylesheet to make it work with your site's search feature
- neither ITSS nor Google will provide support for extensive customization
- when you use any stylesheet other than the default, new subcollections will not be automatically added to the subcollections menu
- updates to the search appliance or its configuration may require you to make manual changes in your stylesheet.
Still, you might want to:
- use header images that match the rest of your web site
- remove all but your own subcollection and the "All documents" option from the subcollections menu
Here are the steps to get you started:
- Download the stylesheet: stanford_stylesheet.xslt
- Copy the stylesheet to your web space and give it
a file name related to your subcollection name
e.g.:
mydept-style.xslt - Modify the parameters of the search feature on your
web site, to refer to the new stylesheet.
<form method='get' action='http://find.stanford.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='stanford'/>
<input type='hidden' name='client' value='stanford'/>
<input type='hidden' name='proxystylesheet'
value='http://www.stanford.edu/dept/mydept/mydept-style.xslt'/>
<input type='hidden' name='output' value='xml_no_dtd'/>
<input type='hidden' name='restrict' value='<libraries>'/>
</form> - Customize and test the stylesheet (see notes below)
Notes about customization & testing
Sections of the stylesheet are labelled according to what they affect, and marked either "can be customized" or "do not customize". We strongly recommend you follow these guidelines.
Logo setup (can be customized)
- whether to show logo: 0 for FALSE, 1 (or non-zero) for TRUE
- logo url
- logo size: '' for default image size
********************************************************* -->
<xsl:variable name="show_logo">1</xsl:variable>
<xsl:variable name="logo_url">images/Title_Left.gif</xsl:variable>
<xsl:variable name="logo_width">200</xsl:variable>
<xsl:variable name="logo_height">78</xsl:variable>
If you make changes to the stylesheet you'll want to test its appearance. The Google Search Appliance caches stylesheets, so to force it to reload your stylesheet when you've made a change, add this line to the search feature's <form> tag (see step 3 above):
Since forcing a reload may slow the display of the results page, you should remove this line when your testing is complete and you're ready to publish your page on the web.
If you have questions about subcollections or the subcollection stylesheet, enter a HelpSU request.




internal