Index: documentation/trunk/tutorials/xml-source/tutorial_en.xml
===================================================================
--- documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 28556)
+++ documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 28598)
@@ -758,4 +758,6 @@
 </Content>
 </Tutorial>
+<!--
+<MajorVersion number="3">
 <Tutorial id="images_gps">
 <Title>
@@ -767,11 +769,14 @@
 <Content>
 <Comment>
-<Text id="images-gps-0">In this tutorial, we'll be looking at a building a collection that takes advantage of the location metadata embedded in the image files to present the spatial features meaningfully.</Text>
-</Comment>
-<NumberedItem>
-<Text id="images-gps-1">Create a new collection in GLI called <i>Images-GPS</i>. In the <b>Gather</b> panel, drag and drop the 4 folders in <Path>sample_files &rarr; images_gps</Path> from the file system view on the left into your collection view on the right.</Text>
-</NumberedItem>
-<NumberedItem>
-<Text id="images-gps-2">In the <b>Document Plugins</b> section of the <b>Design</b> panel, go down to the <b>select plugin to add</b> and choose the EmbeddedMetadataPlugin. Press the <b>Add Plugin</b> button to add it to the plugin list. Select this plugin in the list, then use the <b>Move Up</b> button to shift it upwards until it comes just after the GreenstoneXMLPlugin.</Text>
+<Text id="images-gps-0">In this tutorial, we'll be looking at building a collection that takes advantage of the GPS metadata embedded in image files. Using this data, we can plot the images on a map based on where they were taken.</Text>
+</Comment>
+<NumberedItem>
+<Text id="images-gps-1">Create a new collection in GLI called <i>Images-GPS</i>. In the <b>Gather</b> panel, drag and drop the 4 folders in <Path>sample_files &rarr; images_gps</Path> from the Workspace view on the left into the Collection view on the right.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="images-gps-1a">Since the images are organised by folder, we can easily assign <i>folder-level</i> metadata to the images which will help with classifying them. In the <b>Enrich</b> panel, select the eiffel-tower folder, and in its <b>dc.Title</b> field type <i>Eiffel Tower</i>. Since this metadata is assigned at folder level, it is inherited as <b>dc.Title</b> metadata by all the images in the folder. Now select each of the remaining folders in turn, and assign the appropriate values for their <b>dc.Title</b>: <i>MusÃ©e d'Orsay</i>, <i>Parc de Luxembourg</i> and <i>PanthÃ©on district</i>, respectively.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="images-gps-2">In the <b>Document Plugins</b> section of the <b>Design</b> panel, go down to the <b>select plugin to add</b> and choose the <b>EmbeddedMetadataPlugin</b>. Press the <b>Add Plugin</b> button, and then click <b>OK</b> to add it to the plugin list. Select this plugin in the list, then use the <b>Move Up</b> button to shift it upwards until it comes just after the GreenstoneXMLPlugin.</Text>
 </NumberedItem>
 <NumberedItem>
@@ -779,17 +784,14 @@
 </NumberedItem>
 <NumberedItem>
-<Text id="images-gps-4">If you were to preview it at this stage, it would just be a simple image collection. However, as these images contain GPS metadata embedded into them, building the collection the first time would have extracted this. We can use this extracted location metadata to display the location data in these images more meaningfully. Move to the <b>Enrich</b> pane, expand a folder, select an image and scroll through its extracted metadata to find several pieces of metadata specifying Latitude and Longitude information: ex.LatShort, ex.Latitude, ex.LngShort and ex.Longitude.</Text>
-</NumberedItem>
-<NumberedItem>
-<Text id="images-gps-5">First though, since the images are organised by folder, we can easily assign <i>folder-level</i> metadata to the images which will help with classifying them. Still in the <b>Enrich</b> tab, select the eiffel-tower folder, and in its <b>dc.Title</b> field type <i>Eiffel Tower</i>. Since this metadata is assigned at folder level, it is inherited as <b>dc.Title</b> metadata by all the images in the folder. Now select each of the remaining folders in turn, and assign the appropriate values for their <b>dc.Title</b>: <i>MusÃ©e d'Orsay</i>, <i>Parc de Luxembourg</i> and <i>PanthÃ©on district</i>.</Text> 
-</NumberedItem>
-<NumberedItem>
-<Text id="images-gps-6">Shift over to the <b>Design</b> panel, select <b>Search Indexes</b> on the left and press the <b>New Index</b> button on the right. Scroll down to the ex.LatShort, ex.Latitude, ex.LngShort and ex.Longitude metadata and tick the boxes for all four and press <b>Add Index</b> to create an index on all these 4 pieces of metadata.</Text> 
-</NumberedItem>
-<NumberedItem>
-<Text id="images-gps-7">Select <b>Browsing Classifiers</b> to the left of the <b>Design</b> tab. In the <b>select classifier to add</b> dropdown box, choose <b>AZCompactList</b> and press <b>Add Classifier</b>. In the configuration dialog that appears, set the metadata field to <b>dc.Title</b> to create a classifier that groups all images under Eiffel Tower into one bookshelf and similarly creates bookshelves for the other 3 categories.</Text> 
-</NumberedItem>
-<NumberedItem>
-<Text id="images-gps-8">Greenstone has a map view that can make use of this location metadata to present the images. To enable the map, move to the <b>Format</b> panel, select <b>Format Features</b> on the left, select the format statement for the <b>browse</b> classifier. In the editor below, prefix the following format statement <i>above</i> the documentNode template:</Text>
+<Text id="images-gps-4">Preview the collection and click the <b>Titles</b> tab. This is what an image collection looks like by default. However, these images have embedded GPS metadata, and we can use this extracted GPS metadata to display these images more meaningfully. In the <b>Enrich</b> panel, expand the <b>eiffel-tower</b> folder and select the first image. Scroll down to see the metadata extracted during the building process. Among the extracted metadta, you will  find several pieces of Latitude and Longitude metadata, which will will be taking advantage of: ex.LatShort, ex.Latitude, ex.LngShort and ex.Longitude. Greenstone has a map view that can make use of this location metadata to present the images.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="images-gps-6">In the <b>Search Indexes</b> section of the <b>Design</b> panel, press the <b>New Index...</b> button. Scroll down and tick the boxes for <b>ex.LatShort</b>, <b>ex.Latitude</b>, <b>ex.LngShort</b> and <b>ex.Longitude</b> and press <b>Add Index</b> to create an index on all these 4 pieces of metadata.</Text> 
+</NumberedItem>
+<NumberedItem>
+<Text id="images-gps-7">In the <b>Browsing Classifiers</b> section, choose <b>AZCompactList</b> from the <b>select classifier to add</b> dropdown box and press <b>Add Classifier...</b>. In the configuration dialog that appears, set the metadata field to <b>dc.Title</b> to create a classifier that groups all images under Eiffel Tower into one bookshelf and similarly creates bookshelves for the other 3 categories.</Text> 
+</NumberedItem>
+<NumberedItem>
+<Text id="images-gps-8">To enable the map, go to the <b>Format Features</b> section of the <b>Format</b> panel, and select the <b>browse</b> format feature. In the editor below, enter the following format statement <i>above</i> the documentNode template:</Text>
 <Format>&lt;gsf:option name="mapEnabled" value="true" /&gt;</Format> 
 </NumberedItem>
@@ -802,4 +804,5 @@
 </Content>
 </Tutorial>
+</MajorVersion-->
 <Tutorial id="word_pdf_collection">
 <Title>
@@ -5178,22 +5181,28 @@
 <Text id="hp-23">Add the following template before the final <i>&lt;/xsl:stylesheet&gt;</i>:</Text>
 <Format>
-&lt;xsl:template name="loginButton"&gt;<br />
-	<Tab n="1"/>&lt;xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/&gt;<br />
-	<Tab n="1"/>&lt;xsl:choose&gt;<br />
-		<Tab n="2"/>&lt;xsl:when test="$username"&gt;<br />
-			<Tab n="3"/>&lt;li&gt;&lt;a&gt;<br />
-				<Tab n="4"/>&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;/admin/AccountSettings?s1.username=&lt;xsl:value-of select="$username"/&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="$username"/&gt;<br />
-			<Tab n="3"/>&lt;/a&gt;&lt;/li&gt;<br />
-			<Tab n="3"/>&lt;li&gt;&lt;a href="{$library_name}/admin/AddUser"&gt;Register a new user&lt;/a&gt;&lt;/li&gt;<br />
-					<Tab n="4"/>&lt;li&gt;&lt;a href="{$library_name}/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
-			<Tab n="3"/>&lt;li&gt;&lt;a&gt;&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;?logout=&lt;/xsl:attribute&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
-		<Tab n="2"/>&lt;/xsl:when&gt;<br />
-		<Tab n="2"/>&lt;xsl:otherwise&gt;<br />
-			<Tab n="3"/>&lt;li&gt;&lt;a href="?a=p&amp;amp;sa=login&amp;amp;redirectURL={$library_name}%3Fa=p%26sa=home"&gt;Login<br />
-				<Tab n="4"/>&lt;xsl:attribute name="title"&gt;&lt;xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/&gt;&lt;/xsl:attribute&gt;<br />
-			<Tab n="3"/>&lt;/a&gt;&lt;/li&gt;<br />
-		<Tab n="2"/>&lt;/xsl:otherwise&gt;<br />
-	<Tab n="1"/>&lt;/xsl:choose&gt;<br />					
-&lt;/xsl:template&gt;<br />
+<Tab n="1"/>&lt;xsl:template name="loginButton"&gt;<br />
+<Tab n="2"/>&lt;xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/&gt;<br />
+<Tab n="2"/>&lt;xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/&gt;<br /><br />
+
+<Tab n="2"/>&lt;xsl:choose&gt;<br />
+	<Tab n="3"/>&lt;xsl:when test="$username"&gt;<br />
+		<Tab n="4"/>&lt;xsl:if test="contains($groups,'admin')"&gt;<br />
+		<Tab n="5"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/AddUser"&gt;Add user&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="5"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="4"/>&lt;/xsl:if&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/AccountSettings?s1.username={$username}"&gt;Logged in as: &lt;xsl:value-of select="$username"/&gt;&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;&lt;a href="{$library_name}?logout="&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
+	<Tab n="3"/>&lt;/xsl:when&gt;<br />
+	<Tab n="3"/>&lt;xsl:otherwise&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;<br />
+			<Tab n="5"/>&lt;a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home"&gt;Login<br/>
+				<Tab n="6"/>&lt;xsl:attribute name="title"&gt;<br/>
+					<Tab n="7"/>&lt;xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/&gt;<br/>
+				<Tab n="6"/>&lt;/xsl:attribute&gt;<br/>
+			<Tab n="5"/>&lt;/a&gt;<br />
+		<Tab n="4"/>&lt;/li&gt;<br />
+	<Tab n="3"/>&lt;/xsl:otherwise&gt;<br />
+<Tab n="2"/>&lt;/xsl:choose&gt;<br />
+<Tab n="1"/>&lt;/xsl:template&gt;<br />
 </Format>
 </NumberedItem>
@@ -5236,4 +5245,1013 @@
 </Content>
 </Tutorial>
+<Tutorial id="defining_libraries">
+<Title>
+<Text id="dl-01">Defining Libraries</Text>
+</Title>
+<SampleFiles folder="libraries"/>
+<Version initial="3.06" current="3.06"/>
+<Content>
+<Comment>
+<Text id="dl-c1">Greenstone3 is built on the idea of sites and interfaces. <b>Sites</b> mainly contain <i>content</i>, i.e. they contain collections, which, in turn, contain documents and associated metadata. Sites are a convenient way to group collections. <br/><br/></Text>
+<Text id="dl-c2"><b>Interfaces</b> dictate the presentation -- e.g. the HTML, CSS, Javascript, etc. used to present the content. You can have multiple sites and interfaces. <br/><br/></Text>
+<Text id="dl-c3"><b>Libraries</b> combine content and presentation. To define a library, you select the site and the interface you want it to use. And, of course, you can have multiple libraries, and each site and interface can be used multiple times.  <br/><br/></Text>
+<Text id="dl-c4">In this tutorial, we will become familiar with <b>web.xml</b>, where we can define new libraries; create a new site; add an interface; and define a new library.</Text>
+</Comment>
+<Heading>
+<Text id="dl-h1">Exploring libraries</Text>
+</Heading>
+<NumberedItem>
+<Text id="dl-02">Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3.06 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page. This library uses the site called <b>localsite</b> and the interface called <b>default</b>. </Text>
+
+<Text id="dl-03">Change the url from <i>http://localhost:8383/greenstone3/library</i> to <i>http://localhost:8383/greenstone3/gs2-library</i> and reload the page. This is another library that is defined by Greenstone3. Again, the site it uses is <b>localsite</b>, but this library (called <b>gs2-library</b>) uses the <b>gs2</b> interface, which is based on the Greenstone2 layout. Let's take a look at where these libraries are defined.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-04">In a Windows Explorer, navigate to the <Path>Greenstone3 &rarr; web &rarr; WEB-INF </Path> folder and open <b>web.xml</b> in a text editor. Scroll down until you see this section:
+</Text>
+
+<Format>
+		<Tab n="1"/>&lt;servlet&gt;<br/>
+			<Tab n="2"/>&lt;servlet-name&gt;library&lt;/servlet-name&gt;<br/>
+			<Tab n="2"/>&lt;description&gt;The standard gsdl3 library program&lt;/description&gt;<br/>
+			<Tab n="2"/>&lt;servlet-class&gt;org.greenstone.gsdl3.LibraryServlet&lt;/servlet-class&gt;<br/>
+			<Tab n="2"/>&lt;init-param&gt;<br/>
+				<Tab n="3"/>&lt;param-name&gt;library_name&lt;/param-name&gt;<br/>
+				<Tab n="3"/>&lt;param-value&gt;library&lt;/param-value&gt;<br/><br/>
+	<Tab n="1"/>...<br/><br/>
+			
+			<Tab n="2"/>&lt;init-param&gt;<br/>
+				<Tab n="3"/>&lt;param-name&gt;default_lang&lt;/param-name&gt;<br/>
+				<Tab n="3"/>&lt;param-value&gt;en&lt;/param-value&gt;<br/>
+			<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="1"/>&lt;/servlet&gt;<br/></Format>
+
+
+
+<Text id="hp-05">This <i>library servlet</i> defines the default Greenstone3 library (called <b>library</b>). As you can see, the <b>library_name</b> is <i>library</i>, the <b>site_name</b> is <i>localsite</i>, and the <b>interface_name</b> is <i>default</i>. If you look at the next servlet section, you will see that it has a library_name of <i>gs2-library</i>, uses <i>localsite</i> and the interface <i>gs2</i>. If you continue to scroll down, you will see several other library servlets defined. There are also other kinds of servlets, for example, you will see a servlet called <i>oaiserver</i>, which provides the functionality for the OAI server (located at <i>http://localhost:8383/greenstone3/oaiserver</i> ).</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-06">Near the bottom of the file, you will see a list of <b>servlet mappings</b> that look like this:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet-mapping&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;library&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;url-pattern&gt;/library/*&lt;/url-pattern&gt;<br/>
+	<Tab n="1"/>&lt;/servlet-mapping&gt;<br/>
+</Format>
+<Text id="dl-07">Every servlet -- and, therefore, every library we define -- needs a servlet mapping, which tells the server at what URL the servlet should be located. (Notice that the servlet-name here is the same as above, and the url-pattern matches the library_name; this is required. The servlet-name does not have to match the library_name/url-pattern, but it is good practice to make them all the same.)</Text>
+<Text id="dl-08">Now that we've seen how libraries are defined in Greenstone3, let's take a look at where sites are located, how to create a new site, and how to define a new library that uses this site.</Text>
+</NumberedItem>
+<Heading>
+<Text id="dl-h2">Creating a new site</Text>
+</Heading>
+<NumberedItem>
+<Text id="dl-09">Sites are located in <Path>Greenstone3 &rarr; web &rarr; sites</Path>. In this folder, you will see two sites: <i>gateway</i> and <i>localsite</i>. (<i>gateway</i> is a bit different, and it won't be discussed in this tutorial.) Create a new folder in sites called <b>mysite</b>. This will be the name of your new site. In <b>mysite</b>, create a folder called <b>collect</b>. This is where all of this site's collections will be located. Finally, copy the <b>siteConfig.xml</b> file from the <b>localsite</b> folder into the <b>mysite</b> folder. (You can, of course, make modifications to the siteConfig.xml to configure your site, but, for simplicity's sake, we'll just use an exact copy.) </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-10">You have now created a site called <b>mysite</b>. However, it has no content yet, and it would be nice to have at least one collection in your new site. From <Path>localsite &rarr; collect</Path>, copy the folder <b>lucene-jdbm-demo</b>, and paste it into <Path>mysite &rarr; collect</Path>.</Text>
+</NumberedItem>
+<Heading>
+<Text id="dl-h3">Defining a new library</Text>
+</Heading>
+<NumberedItem>
+<Text id="dl-11">Now, let's define a library that uses this new site. In <b>web.xml</b>, add the following (which can be copied from <Path>sample_files &rarr; libraries &rarr; def_libs.txt</Path>);  The exact location doesn't matter, just put it with the other servlets:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;library2&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;description&gt;A new library with my new site!&lt;/description&gt;<br/>
+		<Tab n="2"/>&lt;servlet-class&gt;org.greenstone.gsdl3.LibraryServlet&lt;/servlet-class&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;library_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;library2&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;site_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;mysite&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;interface_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;default&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;receptionist_class&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;DefaultReceptionist&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;default_lang&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;en&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+	<Tab n="1"/>&lt;/servlet&gt;<br/>
+</Format>
+<Text id="dl-12">This defines a new library called <b>library2</b> that uses <b>mysite</b> and the <b>default</b> interface. Now, near the bottom of the file, add in a servlet mapping to tell the server where our new library should be located:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet-mapping&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;library2&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;url-pattern&gt;/library2/*&lt;/url-pattern&gt;<br/>
+	<Tab n="1"/>&lt;/servlet-mapping&gt;<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-13">Save <b>web.xml</b>. For the changes to take effect, we must first restart the server. Click the <b>Restart Library</b> button in the Greenstone Server window. When the new browser window opens, navigate to <i>http://localhost:8383/greenstone3/library2</i> to see your newly defined library. Notice that only one collection appears -- the Lucene Demo Collection that we copied into <b>mysite</b>.</Text>
+</NumberedItem>
+<Heading>
+<Text id="dl-h4">Adding and using a new interface</Text>
+</Heading>
+<NumberedItem>
+<Text id="dl-14">Now that we know how to create and use a new site, let's add a new interface and define a library that uses it. Creating a new interface takes time (and is a tutorial all its own), so, for this tutorial, we are just going to use a pre-made interface. From the <Path>sample_files &rarr; libraries</Path> folder, copy the folder <b>althor</b> into the <Path>Greenstone3 &rarr; web &rarr; interfaces</Path> folder. In <b>web.xml</b>, define a new library that uses the althor interface:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;rand&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;description&gt;A new library with my new interface!&lt;/description&gt;<br/>
+		<Tab n="2"/>&lt;servlet-class&gt;org.greenstone.gsdl3.LibraryServlet&lt;/servlet-class&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;library_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;rand&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;site_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;mysite&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;interface_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;althor&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;receptionist_class&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;DefaultReceptionist&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;default_lang&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;en&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+	<Tab n="1"/>&lt;/servlet&gt;<br/>
+</Format>
+<Text id="dl-15">and provide the servlet mapping:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet-mapping&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;rand&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;url-pattern&gt;/rand/*&lt;/url-pattern&gt;<br/>
+	<Tab n="1"/>&lt;/servlet-mapping&gt;	<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-16">Save <b>web.xml</b>, restart the server again and navigate to <i>http://localhost:8383/greenstone3/rand</i>, where you will see the <b>rand</b> library, which displays <b>mysite</b> using the <b>althor</b> interface. </Text>
+</NumberedItem>
+<Heading>
+<Text id="dl-h5">Changing default settings for the Greenstone server and GLI</Text>
+</Heading>
+<NumberedItem>
+<Text id="dl-17">When we restarted the server throughout this tutorial, Greenstone launched a browser window to <i>http://localhost:8383/greenstone3/library</i>, and we had to navigate to our new library's URL. When you are working in a particular library, you may want to go directly to its URL when the server starts. To do this, in the <b>Greenstone Server</b> window, go to <Path>File &rarr; Settings...</Path> and select your library (for example, <b>rand</b>) from the Servlet dropdown menu. Now, when you click <b>Restart Library</b>, a window will open to <i> http://localhost:8383/greenstone3/rand</i>. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-18">In the GLI, you can change the current library under <Path>File &rarr; Preferences &rarr; Connection</Path>. First, select the <b>Site</b> you want to work with (for example, <i>mysite</i>). The <b>Servlet</b> dropdown menu will then include all of the libraries that use <i>mysite</i>. Select one. Be sure to also change the <b>Collect Directory</b> to the  <i>mysite/collect</i> folder. Click <b>OK</b> for the changes to take effect. Now, you will be adding and editing collections in the <b>mysite</b> site, and, when you click the Preview button, the selected library will be launched.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="dl-19">As you begin using multiple libraries while using GLI, you should be aware of a couple of things. First, any changes you make in the GLI are <b>collection-level</b>, which means they will be the consistent for this collection no matter what library you are using. However, changes may only take effect <i>immediately</i> in the current library. The server may need to be restarted for the changes to appear in other libraries. Second, switching between servlets -- or viewing a collection in a library other than the one currently being used by the GLI -- can create a lock on files in a collection, which will cause an error during collection building. To avoid this, if you use multiple libraries after launching the GLI, <b>restart the server</b> before rebuilding a collection.
+</Text>
+</NumberedItem>
+</Content>
+</Tutorial>
+
+
+
+
+
+
+
+
+
+
+
+<Tutorial id="new_interface1">
+<Title>
+<Text id="dl-01">Designing a new interface: Part 1</Text>
+</Title>
+<SampleFiles folder="interfaces"/>
+<Version initial="3.06" current="3.06"/>
+<Content>
+<Comment>
+<Text id="ni1-c1">This tutorial series demonstrates how to create a new interface using the default interface as a base. In this first tutorial, we will set the stage by creating a barebones interface, defining a library that uses the interface, and gathering the various Javascript, CSS, and image files that will be used by the new interface.</Text>
+</Comment>
+<Heading>
+<Text id="ni1-h1">Creating a new interface</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-01">In an Explorer window, navigate to the <b>interfaces</b> folder of your Greenstone3 installation (<Path>C: &rarr; Users &rarr; &lt;user-name&gt; &rarr; Greenstone3 &rarr; web &rarr; interfaces</Path>).  </Text>
+<Text id="ni1-02">Create a new folder (in the right-click menu, select New &rarr; Folder) and call it <b>perrin</b>. The name of this folder (perrin) determines the name of your new interface.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-03">From <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the file <b>interfaceConfig.xml</b>into the <b>perrin</b> folder. Open the file <Path>perrin &rarr; interfaceConfig.xml</Path> in a text editor. The interface configuration file is used to specify the languages the interface is available in, certain options, and what "actions" are available. <b>Actions</b> create the web pages for the library and specify what XSL file should be used for each. For example, if you completed the Home Page Tutorial, you changed the <i>home</i> subaction to point to <i>home-tutorial.xsl</i> instead of <i>home.xsl</i>.</Text>
+
+<Text id="ni1-04">We are going to make one important change to this file. Our new interface is going to borrow heavily from the default interface. We will be reusing many of the XSL files, Javascript, and images. We could copy all of these files into our new interface, however, there are a few drawbacks to this solution:<br /><br />
+<Tab n="1"/>&#8226; we will end up with duplicates of a large number of files <br/>
+<Tab n="1"/>&#8226; there are many files in the default interface that we won't need<br/>
+<Tab n="1"/>&#8226; it will be difficult to keep track of which files are different/unique to our new interface<br/>
+</Text>
+<Text id="ni1-05">A better solution is to base our new interface on the default interface. A base interface is used by Greenstone as a kind of backup. If Greenstone can't find a file in our interface, it will then try to find it in the base interface. To assign default as base interface, in <Path>perrin &rarr; interfaceConfig.xml</Path>, change the second line from this:</Text>
+<Format>
+&lt;interfaceConfig&gt;
+</Format>
+<Text id="ni1-06">To this:</Text>
+<Format>
+&lt;interfaceConfig baseInterface="default"&gt;
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-07">Save and close <b>interfaceConfig.xml</b>. </Text>
+</NumberedItem>
+<Heading>
+<Text id="ni1-h2">Defining a new library</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 &rarr; web &rarr; WEB-INF</Path> open <b>web.xml</b>, and add the following (the exact location doesn't matter, just put it with the other servlets):</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;golden&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;description&gt;A new library with my new interface!&lt;/description&gt;<br/>
+		<Tab n="2"/>&lt;servlet-class&gt;org.greenstone.gsdl3.LibraryServlet&lt;/servlet-class&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;library_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;golden&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;site_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;localsite&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;interface_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;perrin&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;receptionist_class&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;DefaultReceptionist&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;default_lang&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;en&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+	<Tab n="1"/>&lt;/servlet&gt;<br/>
+</Format>
+<Text id="ni1-08">This defines a new library called "golden" that uses "localsite" and our new "perrin" interface. Now, near the bottom of the file, add in a servlet mapping to tell the server where our new library should be located:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet-mapping&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;golden&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;url-pattern&gt;/golden/*&lt;/url-pattern&gt;<br/>
+	<Tab n="1"/>&lt;/servlet-mapping&gt;	<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-09">Save web.xml. Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page.</Text>
+<Text id="ni1-10">Navigate to <Path>http://localhost:8383/greenstone3/golden</Path>. This library is using the <i>perrin</i> interface. However, since <i>perrin</i> contains no files except its configuration file, Greenstone is borrowing everything from <i>default</i>, <i>perrin</i>'s base interface.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni1-h3">Gathering files</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-11">To change how the perrin interface looks, we will be adding some key XSL files (<i>home.xsl</i>, <i>header.xsl</i>, and <i>main.xsl</i>). However, before we do that, we want to gather all of the new CSS, Javascript, and image files we will be using with our new interface.</Text>
+<Text id="ni1-12">Since designing web pages is quite challening in itself, we will be taking advantage of free CSS templates that can be downloaded and modified. There are many websites that offer high quality web page designs, often for free. <i>(Always be sure to read the license information fully to ensure you do not violate the usage agreement in any way.)</i></Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-13">Visit <i>http://www.os-templates.com/free-website-templates/news-magazine</i> and click the <b>Download Here</b> button. In the popup window, select <b>Save File</b> and click <b>OK</b>. On Windows, this will save the file <b>news-magazine.zip</b> in your <b>Downloads</b> folder. <i>This template is free to use and modify, but the Copyright and link information <b>must remain intact</b> in files and in the footer of every page. The template <b>cannot be distributed</b> (modified or otherwise) without express permission from OS-Templates (The full license is provided in the <b>license.txt</b> file included with the template).</i></Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-14">In an Explorer window, navigate to your Downloads folder (<Path>C:\Users\&lt;user-name&gt;\Downloads</Path>). Right-click <b>news-magazine.zip</b>, select <b>Extract All...</b> and, in the popup window, click <b>Extract</b>.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-15">From the new news-magazine folder, copy the <b>styles</b>, <b>scripts</b>, and <b>images</b> folders and the <b>license.txt</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path>. </Text>
+<Text id="ni1-16">In the new <Path> perrin &rarr; images </Path> folder, delete everything except the <b>galleryviewthemes</b> folder and its contents, because we will not be using any of the other images. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-17"> In the <Path> perrin &rarr; styles</Path> folder, open layout.css in a text editor and delete the following line:</Text>
+<Format>@import url(tables.css);</Format>
+<Text id="ni1-18">Save and close layout.css. You can also delete the tables.css file, as it is no longer used. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-18">Now, from the <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the <b>styles</b>, <b>images</b>, and <b>transform</b> folders, as well as the <b>index-GS3.html</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path> (If a popup window asks whether you want to merge the images and styles folders, select "Yes".) We have now gathered all of the Javascript, CSS, and images our new interface will use.</Text>
+<Text id="ni1-19">Double click on <Path>perrin &rarr; index-GS3.html</Path> to open it in a browser window. This file isn't used by the new interface, but provides a preview of how the interface will look. </Text>
+<Text id="ni1-20">In the next tutorial, we will begin changing how our interface looks, starting with the home page.</Text>
+</NumberedItem>
+</Content>
+</Tutorial>
+<Tutorial id="new_interface1">
+<Title>
+<Text id="dl-01">Designing a new interface: Part 1</Text>
+</Title>
+<SampleFiles folder="interfaces"/>
+<Version initial="3.06" current="3.06"/>
+<Content>
+<Comment>
+<Text id="ni1-c1">This tutorial series demonstrates how to create a new interface using the default interface as a base. In this first tutorial, we will set the stage by creating a barebones interface, defining a library that uses the interface, and gathering the various Javascript, CSS, and image files that will be used by the new interface.</Text>
+</Comment>
+<Heading>
+<Text id="ni1-h1">Creating a new interface</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-01">In an Explorer window, navigate to the <b>interfaces</b> folder of your Greenstone3 installation (<Path>C: &rarr; Users &rarr; &lt;user-name&gt; &rarr; Greenstone3 &rarr; web &rarr; interfaces</Path>).  </Text>
+<Text id="ni1-02">Create a new folder (in the right-click menu, select New &rarr; Folder) and call it <b>perrin</b>. The name of this folder (perrin) determines the name of your new interface.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-03">From <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the file <b>interfaceConfig.xml</b>into the <b>perrin</b> folder. Open the file <Path>perrin &rarr; interfaceConfig.xml</Path> in a text editor. The interface configuration file is used to specify the languages the interface is available in, certain options, and what "actions" are available. <b>Actions</b> create the web pages for the library and specify what XSL file should be used for each. For example, if you completed the Home Page Tutorial, you changed the <i>home</i> subaction to point to <i>home-tutorial.xsl</i> instead of <i>home.xsl</i>.</Text>
+
+<Text id="ni1-04">We are going to make one important change to this file. Our new interface is going to borrow heavily from the default interface. We will be reusing many of the XSL files, Javascript, and images. We could copy all of these files into our new interface, however, there are a few drawbacks to this solution:<br /><br />
+<Tab n="1"/>&#8226; we will end up with duplicates of a large number of files <br/>
+<Tab n="1"/>&#8226; there are many files in the default interface that we won't need<br/>
+<Tab n="1"/>&#8226; it will be difficult to keep track of which files are different/unique to our new interface<br/>
+</Text>
+<Text id="ni1-05">A better solution is to base our new interface on the default interface. A base interface is used by Greenstone as a kind of backup. If Greenstone can't find a file in our interface, it will then try to find it in the base interface. To assign default as base interface, in <Path>perrin &rarr; interfaceConfig.xml</Path>, change the second line from this:</Text>
+<Format>
+&lt;interfaceConfig&gt;
+</Format>
+<Text id="ni1-06">To this:</Text>
+<Format>
+&lt;interfaceConfig baseInterface="default"&gt;
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-07">Save and close <b>interfaceConfig.xml</b>. </Text>
+</NumberedItem>
+<Heading>
+<Text id="ni1-h2">Defining a new library</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 &rarr; web &rarr; WEB-INF</Path> open <b>web.xml</b>, and add the following (the exact location doesn't matter, just put it with the other servlets):</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;golden&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;description&gt;A new library with my new interface!&lt;/description&gt;<br/>
+		<Tab n="2"/>&lt;servlet-class&gt;org.greenstone.gsdl3.LibraryServlet&lt;/servlet-class&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;library_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;golden&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;site_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;localsite&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;interface_name&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;perrin&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;receptionist_class&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;DefaultReceptionist&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+		<Tab n="2"/>&lt;init-param&gt;<br/>
+			<Tab n="3"/>&lt;param-name&gt;default_lang&lt;/param-name&gt;<br/>
+			<Tab n="3"/>&lt;param-value&gt;en&lt;/param-value&gt;<br/>
+		<Tab n="2"/>&lt;/init-param&gt;<br/>
+	<Tab n="1"/>&lt;/servlet&gt;<br/>
+</Format>
+<Text id="ni1-08">This defines a new library called "golden" that uses "localsite" and our new "perrin" interface. Now, near the bottom of the file, add in a servlet mapping to tell the server where our new library should be located:</Text>
+<Format>
+	<Tab n="1"/>&lt;servlet-mapping&gt;<br/>
+		<Tab n="2"/>&lt;servlet-name&gt;golden&lt;/servlet-name&gt;<br/>
+		<Tab n="2"/>&lt;url-pattern&gt;/golden/*&lt;/url-pattern&gt;<br/>
+	<Tab n="1"/>&lt;/servlet-mapping&gt;	<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-09">Save web.xml. Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page.</Text>
+<Text id="ni1-10">Navigate to <Path>http://localhost:8383/greenstone3/golden</Path>. This library is using the <i>perrin</i> interface. However, since <i>perrin</i> contains no files except its configuration file, Greenstone is borrowing everything from <i>default</i>, <i>perrin</i>'s base interface.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni1-h3">Gathering files</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni1-11">To change how the perrin interface looks, we will be adding some key XSL files (<i>home.xsl</i>, <i>header.xsl</i>, and <i>main.xsl</i>). However, before we do that, we want to gather all of the new CSS, Javascript, and image files we will be using with our new interface.</Text>
+<Text id="ni1-12">Since designing web pages is quite challening in itself, we will be taking advantage of free CSS templates that can be downloaded and modified. There are many websites that offer high quality web page designs, often for free. <i>(Always be sure to read the license information fully to ensure you do not violate the usage agreement in any way.)</i></Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-13">Visit <Link url="http://www.os-templates.com/free-website-templates/news-magazine">http://www.os-templates.com/free-website-templates/news-magazine</Link> and click the <b>Download Here</b> button. In the popup window, select <b>Save File</b> and click <b>OK</b>. On Windows, this will save the file <b>news-magazine.zip</b> in your <b>Downloads</b> folder. <i>This template is free to use and modify, but the Copyright and link information <b>must remain intact</b> in files and in the footer of every page. The template <b>cannot be distributed</b> (modified or otherwise) without express permission from OS-Templates (The full license is provided in the <b>license.txt</b> file included with the template).</i></Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-14">In an Explorer window, navigate to your Downloads folder (<Path>C:\Users\&lt;user-name&gt;\Downloads</Path>). Right-click <b>news-magazine.zip</b>, select <b>Extract All...</b> and, in the popup window, click <b>Extract</b>.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-15">From the new news-magazine folder, copy the <b>styles</b>, <b>scripts</b>, and <b>images</b> folders and the <b>license.txt</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path>. </Text>
+<Text id="ni1-16">In the new <Path> perrin &rarr; images </Path> folder, delete everything except the <b>galleryviewthemes</b> folder and its contents, because we will not be using any of the other images. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-17"> In the <Path> perrin &rarr; styles</Path> folder, open <b>layout.css</b> in a text editor and delete the following line:</Text>
+<Format>@import url(tables.css);</Format>
+<Text id="ni1-18">Save and close <b>layout.css</b>. You can also delete the <b>tables.css</b> file, as it is no longer used. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni1-18">Now, from the <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the <b>styles</b>, <b>images</b>, and <b>transform</b> folders, as well as the <b>index-GS3.html</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path> (If a popup window asks whether you want to merge the images and styles folders, select "Yes".) We have now gathered all of the Javascript, CSS, and images our new interface will use.</Text>
+<Text id="ni1-19">Double click on <Path>perrin &rarr; index-GS3.html</Path> to open it in a browser window. This file isn't used by the new interface, but provides a preview of how the interface will look. </Text>
+<Text id="ni1-20">In the next tutorial, we will begin changing how our interface looks, starting with the home page.</Text>
+</NumberedItem>
+</Content>
+</Tutorial>
+
+
+<Tutorial id="new_interface2">
+<Title>
+<Text id="dl-01">Designing a new interface: Part 2</Text>
+</Title>
+<SampleFiles folder="interfaces"/>
+<Version initial="3.06" current="3.06"/>
+<Content>
+<Comment>
+<Text id="ni2-c1">In this tutorial, we will be adding <b>home.xsl</b> and <b>header.xsl</b> files to the <b>perrin</b> interface. Modifying XSL files must be done with care. If the XSL is ill-formed or invalid, the page will not display properly. This tutorial attempts to highlight some of the common mistakes that might result in errors. Whenever you are editing XSL files, remember to <b>save very often</b>, and then refresh your browser to see if there is an error.</Text>
+</Comment>
+<NumberedItem>
+<Text id="ni2-01">Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button and navigate to <i>http://localhost:8383/greenstone3/golden</i> in the web browser, which still looks identical to the home page of the default interface. </Text>
+</NumberedItem>
+<Heading>
+<Text id="ni2-h1">Changing the home page content</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni2-02">From the <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy <b>home.xsl</b> into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin &rarr; transform &rarr; pages</Path>. In the browser, refresh the library home page. The content of the page should now be only "HOME PAGE CONTENT GOES HERE". Open <b>home.xsl</b> in a text editor and take a look at it.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-03">In a previous tutorial, we created a home page that was completely different than the rest of our library's pages. This time, however, the home page will share a large portion of it's layout and style with the rest of the library's pages. So, we're only going to change the home page's <i>content</i> by modifying the <b>/page/pageResponse</b> template. We will be adding three sections to our home page: an image slider, a section that can contain featured content, and a list of all of the collections in the library, along with their descriptions.</Text>
+<Text id="ni2-04">Replace HOME PAGE CONTENT GOES HERE with the following:
+</Text>
+<Format>
+	<Tab n="1"/>&lt;div class="content"&gt;<br />
+      <Tab n="2"/>&lt;div id="featured_slide"&gt;<br />
+        <Tab n="3"/>&lt;ul id="featurednews"&gt;<br />
+			<Tab n="4"/>&lt;xsl:call-template name="collSlider"/&gt;<br />
+        <Tab n="3"/>&lt;/ul&gt;<br />
+      <Tab n="2"/>&lt;/div&gt;<br />
+    <Tab n="1"/>&lt;/div&gt;<br />
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-05">Save <b>home.xsl</b> and refresh your web browser. You should now see an <i>Apache Tomcat</i> error. This is because we are calling a template (<i>collSlider</i>) that doesn't exist. Now add the following before the final &lt;/xsl:stylesheet&gt;:</Text>
+<Format>
+	<Tab n="1"/>&lt;xsl:template name="collSlider"&gt;<br />
+		<Tab n="2"/>&lt;xsl:for-each select="./collectionList/collection"&gt;<br />
+			<Tab n="3"/>&lt;xsl:variable name="collectionFolder" select="@name"/&gt;<br />
+			<Tab n="3"/>&lt;xsl:variable name="collectionName" select="displayItem[@name='name']"/&gt;<br />
+			<Tab n="3"/>&lt;xsl:variable name="homeImage"&gt;<br />
+				<Tab n="4"/>&lt;xsl:choose&gt;<br />
+					<Tab n="5"/>&lt;xsl:when test="displayItem[@name='smallicon']"&gt;<br />
+						<Tab n="6"/>sites/&lt;xsl:value-of select="$site_name"/&gt;/collect/&lt;xsl:value-of select="$collectionFolder"/&gt;/images/&lt;xsl:value-of select="displayItem[@name='smallicon']"/&gt;<br />
+					<Tab n="5"/>&lt;/xsl:when&gt;<br />
+					<Tab n="5"/>&lt;xsl:otherwise&gt;<br />
+						<Tab n="6"/>interfaces/&lt;xsl:value-of select="$interface_name"/&gt;/images/default.jpg<br />
+					<Tab n="5"/>&lt;/xsl:otherwise&gt;<br />
+				<Tab n="4"/><Tab n=""/>&lt;/xsl:choose&gt;<br />
+			<Tab n="3"/>&lt;/xsl:variable&gt;<br /><br />
+
+			<Tab n="3"/>&lt;li&gt;&lt;img src="{$homeImage}" alt="" /&gt;<br />
+				<Tab n="4"/>&lt;div class="panel-overlay"&gt;<br />
+					<Tab n="5"/>&lt;a href="{$library_name}/collection/{$collectionFolder}/page/about"&gt;<br />
+						<Tab n="6"/>&lt;h2&gt;&lt;xsl:value-of select="$collectionName"/&gt;&lt;/h2&gt;<br />
+					<Tab n="5"/>&lt;/a&gt;<br />
+				<Tab n="4"/>&lt;/div&gt;<br />
+          <Tab n="3"/>&lt;/li&gt;<br />
+		<Tab n="2"/>&lt;/xsl:for-each&gt;<br />
+	<Tab n="1"/>&lt;/xsl:template&gt;<br />
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-06">Save <b>home.xsl</b> and refresh your web browser. You should no longer have an error. For every collection in your library, you should now see an image followed by the collection's name. In a moment, we will add in the Javascript that will turn these into a slider, but first, let's consider what the collSlider template is doing.</Text>
+<Text id="ni2-07">Basically, for every collection in your library (&lt;xsl:for-each select="./collectionList/collection"&gt;), it is creating a list item than includes an image and the collection's name, which links to the collection's about page. If the collection has a Home page image (the "smallicon"), this will be displayed. Otherwise a backup image (<i>default.jpg</i>, which is located in <Path>perrin &rarr; images</Path>) will be displayed. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-08">Now, add Javascript files that will turn these list items into an image slider. Before the final &lt;/xsl:stylesheet&gt;, add the following:</Text>
+<Format>
+	<Tab n="1"/>&lt;xsl:template name="additionalHeaderContent"&gt;<br />
+		<Tab n="2"/>&lt;script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;/script&gt;<br />
+		<Tab n="2"/>&lt;script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;/script&gt;<br />
+		<Tab n="2"/>&lt;script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;/script&gt;<br />
+		<Tab n="2"/>&lt;script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;/script&gt;<br />
+	<Tab n="1"/>&lt;/xsl:template&gt;	<br />
+</Format>
+<Text id="ni2-09">Save home.xsl and refresh your web browser. All of the images and collection names should now be condensed into an image slider. (It is still missing some style, because we haven't added links to our CSS files yet.) This <b>additionalHeaderContent</b> template is "called" in the <b>header.xsl</b> file, which we will see later in this tutorial.
+</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-10">Add the next section of of the home page's content. Insert the highlighted section: </Text>
+<Format>
+					<Tab n="5"/>&lt;xsl:call-template name="collSlider"/&gt;<br />
+				<Tab n="4"/>&lt;/ul&gt;<br />
+			<Tab n="3"/>&lt;/div&gt;<br />
+		<Tab n="2"/>&lt;/div&gt;<br />
+		<Tab n="2"/><highlight>&lt;div class="column"&gt;<br />
+			<Tab n="3"/>&lt;ul class="latestnews"&gt;<br />
+				<Tab n="4"/>&lt;li&gt;<br />
+					<Tab n="5"/>&lt;p&gt;&lt;strong&gt;&lt;a href="#"&gt;Highlighted Item 1&lt;/a&gt;&lt;/strong&gt;&lt;br/&gt;This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.&lt;/p&gt;<br />
+				<Tab n="4"/>&lt;/li&gt;<br />
+				<Tab n="4"/>&lt;li&gt;&lt;img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" /&gt;<br />
+					<Tab n="5"/>&lt;p&gt;&lt;strong&gt;&lt;a href="#"&gt;Highlighted Item 2&lt;/a&gt;&lt;/strong&gt;&lt;br/&gt;This is a place where you can put information about an item you would like to highlight in your collection,with or without an accompanying image.&lt;/p&gt;<br />
+				<Tab n="4"/>&lt;/li&gt;<br />
+				<Tab n="4"/>&lt;li class="last"&gt;&lt;img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" /&gt;<br />
+					<Tab n="5"/>&lt;p&gt;&lt;strong&gt;&lt;a href="#"&gt;Highlighted Item 3&lt;/a&gt;&lt;/strong&gt;&lt;br/&gt;This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.&lt;/p&gt;<br />
+				<Tab n="4"/>&lt;/li&gt;<br />
+			<Tab n="3"/>&lt;/ul&gt;<br />
+		<Tab n="2"/>&lt;/div&gt;<br />
+		<Tab n="2"/>&lt;br class="clear" /&gt;</highlight><br />
+	<Tab n="1"/>&lt;/xsl:template&gt;<br />
+</Format>
+<Text id="ni2-11">Save <b>home.xsl</b> and refresh your web browser. This section will be an area where you can add in your own content. Notice the file paths for the image files begin with <b>interfaces/{$interface_name}</b>. As its name suggests, <b>{$interface_name}</b> becomes the name of the interface, in this case "perrin".</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-12">Finally, add in the highlighted section:</Text>
+<Format>
+		<Tab n="2"/>&lt;br class="clear" /&gt;<br /><br />
+			
+		<Tab n="2"/><highlight>&lt;div id="hpage_cats"&gt;<br />
+			<Tab n="3"/>&lt;xsl:call-template name="collectionsList"/&gt;<br />
+		<Tab n="2"/>&lt;/div&gt;</highlight><br />
+	<Tab n="1"/>&lt;/xsl:template&gt;<br />
+</Format>
+<Text id="ni2-13">And add the following templates before the final &lt;/xsl:stylesheet&gt;:</Text>
+<Format>
+	<Tab n="1"/>&lt;xsl:template name="collectionsList"&gt;<br />
+		<Tab n="2"/>&lt;xsl:for-each select="./collectionList/collection"&gt;<br />
+			<Tab n="3"/>&lt;xsl:choose&gt;<br />
+				<Tab n="4"/>&lt;xsl:when test="position() mod 2 = 1"&gt;<br />
+					<Tab n="5"/>&lt;div class="fl_left"&gt;<br />
+						<Tab n="6"/>&lt;xsl:call-template name="collDescription"/&gt;<br />
+					<Tab n="5"/>&lt;/div&gt;<br />
+				<Tab n="4"/>&lt;/xsl:when&gt;<br />
+				<Tab n="4"/>&lt;xsl:otherwise&gt;<br />
+					<Tab n="5"/>&lt;div class="fl_right"&gt;<br />
+						<Tab n="6"/>&lt;xsl:call-template name="collDescription"/&gt;<br />
+					<Tab n="5"/>&lt;/div&gt;<br />
+					<Tab n="5"/>&lt;br class="clear" /&gt;<br />
+				<Tab n="4"/>&lt;/xsl:otherwise&gt;<br />
+			<Tab n="3"/>&lt;/xsl:choose&gt;<br />
+		<Tab n="2"/>&lt;/xsl:for-each&gt;<br />
+	<Tab n="1"/>&lt;/xsl:template&gt;	<br /><br />
+
+	<Tab n="1"/>&lt;xsl:template name="collDescription"&gt;<br />
+		<Tab n="2"/>&lt;xsl:variable name="collectionFolder" select="@name"/&gt;<br />
+		<Tab n="2"/>&lt;xsl:variable name="collectionName" select="displayItem[@name='name']"/&gt;<br />
+		<Tab n="2"/>&lt;xsl:variable name="aboutImage" select="displayItem[@name='icon']"/&gt;<br />
+		<Tab n="2"/>&lt;xsl:variable name="collDesc" select="displayItem[@name='description']"/&gt;<br />
+		<Tab n="2"/>&lt;xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/&gt;<br /><br />
+
+		<Tab n="2"/>&lt;h2&gt;&lt;a href="{$library_name}/collection/{$collectionFolder}/page/about"&gt;&lt;xsl:value-of select="$collectionName"/&gt;&lt;/a&gt;&lt;/h2&gt;	  <br />
+		<Tab n="2"/>&lt;xsl:if test="$aboutImage"&gt;<br />
+			<Tab n="3"/>&lt;img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$aboutImage}" alt="{$collectionName}" /&gt;<br />
+		<Tab n="2"/>&lt;/xsl:if&gt;<br /><br />
+
+		<Tab n="2"/>&lt;xsl:choose&gt;<br />
+			<Tab n="3"/>&lt;xsl:when test="$collDesc"&gt;<br />
+				<Tab n="4"/>&lt;p class="justify"&gt;&lt;xsl:value-of select="$collDesc"/&gt;&lt;/p&gt;<br />
+			<Tab n="3"/>&lt;/xsl:when&gt;<br />
+			<Tab n="3"/>&lt;xsl:otherwise&gt;<br />
+				<Tab n="4"/>&lt;p class="justify"&gt;Welcome to the &lt;xsl:value-of select="$collectionName"/&gt; collection. This collection contains &lt;xsl:value-of select="$numDocs"/&gt; documents.&lt;/p&gt;<br />
+			<Tab n="3"/>&lt;/xsl:otherwise&gt;	  <br />
+		<Tab n="2"/>&lt;/xsl:choose&gt;	 <br /> 
+	<Tab n="1"/>&lt;/xsl:template&gt;	<br />		
+</Format>
+<Comment>
+<Text id="ni2-14a">These templates are a more complicated, but a basic explanation follows (don't worry if you don't understand it). You can skip ahead to Step 9 if you'd like.</Text>
+</Comment>
+<Text id="ni2-14">First look at the collDescription template. It creates a header that links to the collection's about page (<Format>&lt;h2&gt;&lt;a href="{$library_name}/collection/{$collectionFolder}/page/about"&gt;&lt;xsl:value-of select="$collectionName"/&gt;&lt;/a&gt;&lt;/h2&gt;</Format>). Then, if there is an About page image for the collection, this is displayed. Finally, if the collection has a description (<Format>&lt;xsl:when test="$collDesc"&gt;</Format>), it will display this description. Otherwise, it will display the a generic sentence stating the collection's name and how many documents it contains.</Text>
+<Text id="ni2-15">Now, let's look at the collectionsList template. Basically, for every collection in the library (<Format>&lt;xsl:for-each select="./collectionList/collection"&gt;</Format>), it is calling the collDescription template, i.e. doing everything explained in the previous paragraph. However, the CSS we are using requires that our div's alternate between class "fl_left" and class "fl_right" or the page won't display correctly. So, if the collection is an odd number in the list (<Format>&lt;xsl:when test="position() mod 2 = 1"&gt;</Format>), the collection description will be in a  <Format>&lt;div class="fl_left"&gt;</Format>, otherwise (i.e. when it is an even number in the list) the collection description will be in a  <Format>&lt;div class="fl_right"&gt;</Format>.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-16">Save and close <b>home.xsl</b> and refresh your web browser, which should now include the names and descriptions (and, accompanying images if any of your collections have an About page image) for each collection in your library.</Text>
+<Text id="ni2-17">We have now made all of our changes to <b>home.xsl</b>. Next, we will add a new <b>header.xsl</b> file, where the HTML header content is located.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni2-h2">Changing the HTML header content</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni2-18">From the <Path> sample_files &rarr; interfaces </Path> folder, copy header.xsl into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin &rarr; transform &rarr; layouts</Path>. Refresh your web browser: nothing should have changed.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-18">Now open <b>header.xsl</b> in a text editor. It contains only one template called "create-html-header", which was copied directly from the default interface's <b>header.xsl</b>. We are going to remove the links to the CSS files used by the default interface, and add in the links to our new CSS files. Scroll down and replace the following lines:</Text>
+<Format>
+		<Tab n="2"/>&lt;xsl:choose&gt;<br />	
+			<Tab n="3"/>&lt;xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value"&gt;<br />	
+				<Tab n="4"/>&lt;!-- Get the theme from the interfaceConfig.xml file --&gt;<br />	
+				<Tab n="4"/>&lt;link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/&gt;<br />	
+			<Tab n="3"/>&lt;/xsl:when&gt;<br />	
+			<Tab n="3"/>&lt;xsl:otherwise&gt;<br />	
+				<Tab n="4"/>&lt;link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/&gt;<br />	
+			<Tab n="3"/>&lt;/xsl:otherwise&gt;<br />	
+		<Tab n="2"/>&lt;/xsl:choose&gt;<br />	
+		<Tab n="2"/>&lt;link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/&gt;<br />	
+</Format>
+<Text id="ni2-19">With this:</Text>
+<Format>
+<Tab n="2"/>&lt;link rel="stylesheet" href="interfaces/{$interface_name}/styles/layout.css" type="text/css" /&gt;<br/>
+<Tab n="2"/>&lt;link rel="stylesheet" href="interfaces/{$interface_name}/styles/gs3-core-min.css" type="text/css" /&gt;<br/>				
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni2-20">Save <b>header.xsl</b> and refresh your web browser. The page should have changed drastically. We removed the links to the default CSS, which removed all of the old style. But, since we added in links to our new CSS, all of the content we just added to the home page should now be styled much better.</Text>
+<Text id="ni2-21">Near the bottom of <b>header.xsl</b>, you will see this line: <Format>&lt;xsl:call-template name="additionalHeaderContent"/&gt;</Format>. For the home page, this is where the four <Format>&lt;script&gt;</Format> elements from Step 6 above will be placed.</Text>
+<Text id="ni2-22">Close <b>header.xsl</b>. In the next and final tutorial on designing an interface, we will add and modify <b>main.xsl</b>.</Text>
+</NumberedItem>
+</Content>
+</Tutorial>
+
+
+<Tutorial id="new_interface3">
+<Title>
+<Text id="dl-01">Designing a new interface: Part 3</Text>
+</Title>
+<SampleFiles folder="interfaces"/>
+<Version initial="3.06" current="3.06"/>
+<Content>
+<Comment>
+<Text id="ni3-c1">In this tutorial, we will change the layout for all of the pages in our library at once by adding and modifying the <b>main.xsl</b> file for our interface.</Text>
+</Comment>
+<Heading>
+<Text id="ni3-h1">Examining main.xsl</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni3-01">From the <Path> sample_files &rarr; interfaces &rarr; aybara </Path> folder, copy <b>main.xsl</b> into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin &rarr; transform &rarr; layouts</Path>. Refresh your web browser -- you should now only see the new content we added to <b>home.xsl</b>. </Text>
+<Text id="ni3-02">Open <b>main.xsl</b> in a text editor. It contains two templates: <b>mainTemplate</b> and <b>gs_footer</b>. The <b>mainTemplate</b> looks like this:</Text>
+<Format>
+<Tab n="1"/>&lt;xsl:template name="mainTemplate"&gt;<br/>
+<Tab n="2"/>&lt;html&gt;<br/>
+	<Tab n="3"/>&lt;head&gt;<br/>
+		<Tab n="4"/>&lt;!-- ***** in header.xsl ***** --&gt;<br/>
+		<Tab n="4"/>&lt;xsl:call-template name="create-html-header"/&gt;<br/>
+	<Tab n="3"/>&lt;/head&gt;<br/>
+	<Tab n="3"/>&lt;body&gt;<br/>
+		<Tab n="4"/>&lt;xsl:apply-templates select="/page"/&gt;<br/>
+		<Tab n="4"/>&lt;xsl:call-template name="gs_footer"/&gt;<br/>
+	<Tab n="3"/>&lt;/body&gt;<br/>
+<Tab n="2"/>&lt;/html&gt;<br/>
+<Tab n="1"/>&lt;/xsl:template&gt;<br/>
+</Format>
+<Text id="ni3-03">Every page in our library uses this template. As you can see, it contains the basic structure of our HTML page. Inside the HTML header, the <b>create-html-header</b> template is called (<Format>&lt;xsl:call-template name="create-html-header"/&gt;</Format>). This is the template in <b>header.xsl</b> we edited in the previously tutorial. Inside the body of the HTML, we use two templates: <b>/page</b> and <b>gs_footer</b>. (The <b>/page</b> template is "applied" instead of called. The reason for this is complex and not relevant to this tutorial.)</Text>
+<Text id="ni3-04"> The <b>/page</b> template is where the content of each individual page is. For the home page, it is the content we just added to <b>home.xsl</b>. Since the <b>perrin</b> interface does not have XSL files for any of the other page types, the content of all of the other pages depends on the default interface: on the collection's about page, it's the collection description; on search pages, it is the query boxes and search results; on document pages it is the document content, etc. </Text>
+<Text id="ni3-04">The <b>gs_footer</b> template is where we will put our page's footer.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-05">Now we will add the HTML that all of the pages of our collection will share. (You might want to take another look at <b>index-GS3.html</b> to remind yourself what the layout will look like.)</Text>
+<Text id="ni3-06">Let's start by adding a footer to our library. In the <b>gs_footer</b> template, immediately after the line <Format>&lt;!-- Put footer in here. --&gt;</Format> insert the following:</Text>
+<Format>
+<Tab n="2"/>&lt;!-- ******DO NOT REMOVE THE LINK TO OS TEMPLATES: Template is free to use/modify, but this link MUST remain on all pages. Do not remove Copyright information. Replace "Your Webpage Here" (and it's link) with your own information.--&gt;<br/>
+<Tab n="2"/>&lt;div class="wrapper col8"&gt;<br/>
+	<Tab n="3"/>&lt;div id="copyright"&gt;<br/>
+      	<Tab n="4"/>&lt;p class="fl_left"&gt;Copyright &#169; 2013 - All Rights Reserved - &lt;a href="#"&gt;Your Webpage Here&lt;/a&gt;&lt;/p&gt;<br/>
+		<Tab n="4"/>&lt;p class="fl_right"&gt;Template by &lt;a href="http://www.os-templates.com/" title="Free Website Templates"&gt;OS Templates&lt;/a&gt;&lt;/p&gt;<br/>
+		<Tab n="4"/>&lt;br class="clear" /&gt;<br/>
+	<Tab n="3"/>&lt;/div&gt;<br/>
+<Tab n="2"/>&lt;/div&gt;<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-07">Save <b>main.xsl</b> and refresh the web browser. The footer will now appear at the bottom of every page. You can click into a collection to see that it is also on these pages. (If your collection does not have a description, the footer will be the only thing that appears on the collection's about page.)</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-08">You'll notice that the image slider and the highlighted items are right up against the edge of the page. In <b>main.xsl</b>, replace <Format>&lt;xsl:apply-templates select="/page"/&gt;</Format> with:</Text>
+<Format>
+	<Tab n="2"/>&lt;div class="wrapper"&gt;<br/>
+  <Tab n="3"/>&lt;div class="container"&gt;<br/>
+		<Tab n="4"/>&lt;xsl:apply-templates select="/page"/&gt;<br/>
+			    <Tab n="4"/>&lt;br class="clear" /&gt;	<br/>
+  <Tab n="3"/>&lt;/div&gt;<br/>
+<Tab n="2"/>&lt;/div&gt;<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-09">Save <b>main.xsl</b> and refresh the web browser. The slider and highlighted items should now line up with the collection descriptions below them. There is also a grey line above the footer.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni3-h2">Adding a navigation bar</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni3-10">Next, we're going to add the navigation bar and quick search box. Since the templates for this are pretty complex, we're going to start by adding only plain HTML to see the basic structure. Insert the following immediately after the <Format>&lt;body&gt;</Format> tag:</Text>
+<Format>
+		<Tab n="2"/>&lt;div class="wrapper col2"&gt;<br/>
+			<Tab n="3"/>&lt;div id="topbar"&gt;<br/>
+				<Tab n="4"/>&lt;div id="topnav"&gt;<br/>
+					<Tab n="5"/>&lt;ul&gt;<br/>
+						<Highlight><Tab n="6"/>&lt;li class="active"&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;<br/>
+						<Tab n="6"/>&lt;li&gt;&lt;a href="style-demo.html"&gt;Browse&lt;/a&gt;<br/>
+							<Tab n="7"/>&lt;ul&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;<br/>
+							<Tab n="7"/>&lt;/ul&gt;<br/>
+						<Tab n="6"/>&lt;/li&gt;<br/>
+						<Tab n="6"/>&lt;li&gt;&lt;a href="#"&gt;Search&lt;/a&gt;<br/>
+							<Tab n="7"/>&lt;ul&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;<br/>
+							<Tab n="7"/>&lt;/ul&gt;<br/>
+						<Tab n="6"/>&lt;/li&gt;</Highlight><br/>
+					<Tab n="5"/>&lt;/ul&gt;<br/>
+				<Tab n="4"/>&lt;/div&gt;<br/>
+				<Tab n="4"/>&lt;!--**********************************************************************--&gt;<br/>
+				<Tab n="4"/>&lt;div id="search"&gt;<br/>
+					<Tab n="5"/>&lt;form action="#" method="post"&gt;<br/>
+						<Tab n="6"/> &lt;fieldset&gt;<br/>
+							<Tab n="7"/>&lt;legend&gt;Site Search&lt;/legend&gt;<br/>
+							<Tab n="7"/>&lt;input type="text" value="Search Our Website&#8230;"  onfocus="this.value=(this.value=='Search Our Website&#8230;')? '' : this.value ;" /&gt;<br/>
+							<Tab n="7"/>&lt;input type="submit" name="go" id="go" value="Search" /&gt;<br/>
+						<Tab n="6"/>&lt;/fieldset&gt;<br/>
+					<Tab n="5"/>&lt;/form&gt;<br/>					
+				<Tab n="4"/>&lt;/div&gt;<br/>	  
+				<Tab n="4"/>&lt;br class="clear" /&gt;<br/>
+				<Tab n="4"/>&lt;div id="advanced"&gt;&lt;a href="#"&gt;advanced search&lt;/a&gt;&lt;/div&gt;<br/>	
+				<Tab n="4"/>&lt;!--**********************************************************************--&gt;<br/>
+			<Tab n="3"/>&lt;/div&gt;<br/>
+		<Tab n="2"/>&lt;/div&gt;<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-11">Save <b>main.xsl</b> and refresh the web browser. The navigation bar should now appear at the top of the screen.</Text>
+<Text id="ni3-12">As you can see in the code above, the navigation links are simply HTML list items, and the dropdown menus are simply lists inside of lists. This is a very common way to make navigation bars.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-13">However, this navigation bar is static. It will be exactly the same for every page in the library. Instead, and we want it to change depending on which page we are on and which collection we are in. To do this, we will be using a couple of pretty complicated looking templates. Just remember, the end result will be HTML structured in the same way as the lists above. First, call the <b>navBar</b> template by replacing this:</Text>
+<Format>
+						<Tab n="6"/>&lt;li class="active"&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;<br/>
+						<Tab n="6"/>&lt;li&gt;&lt;a href="style-demo.html"&gt;Browse&lt;/a&gt;<br/>
+							<Tab n="7"/>&lt;ul&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;<br/>
+							<Tab n="7"/>&lt;/ul&gt;<br/>
+						<Tab n="6"/>&lt;/li&gt;<br/>
+						<Tab n="6"/>&lt;li&gt;&lt;a href="#"&gt;Search&lt;/a&gt;<br/>
+							<Tab n="7"/>&lt;ul&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;<br/>
+								<Tab n="8"/>&lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;<br/>
+							<Tab n="7"/>&lt;/ul&gt;<br/>
+						<Tab n="6"/>&lt;/li&gt;<br/>
+</Format>
+<Text id="ni3-14">with this:</Text>
+<Format>
+						<Tab n="6"/>&lt;xsl:call-template name="navBar"/&gt;
+</Format>
+<Text id="ni3-15">Then add the following templates before the final <Format>&lt;/xsl:stylesheet&gt;</Format>:</Text>
+<Format>
+<Tab n="1"/>&lt;xsl:template name="navBar"&gt;<br />
+	<Tab n="2"/>&lt;xsl:choose&gt;<br />
+		<Tab n="3"/>&lt;xsl:when test="page/pageResponse/collection"&gt;<br />
+			<Tab n="4"/>&lt;xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/&gt;<br />
+			<Tab n="4"/>&lt;xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/&gt;<br /><br />
+	
+			<Tab n="4"/>&lt;li&gt;&lt;a href="{$library_name}"&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
+			<Tab n="4"/>&lt;li&gt;<br />
+				<Tab n="5"/>&lt;xsl:if test="page/pageRequest/@subaction='about'"&gt;&lt;xsl:attribute name="class"&gt;active&lt;/xsl:attribute&gt;&lt;/xsl:if&gt;<br />
+				<Tab n="5"/>&lt;a href="{$library_name}/collection/{$collNameChecked}/page/about"&gt;About&lt;/a&gt;<br />
+			<Tab n="4"/>&lt;/li&gt;<br /><br />
+
+			<Tab n="4"/>&lt;xsl:choose&gt;<br />
+				<Tab n="5"/>&lt;xsl:when test="$count &gt; 3"&gt;<br />
+					<Tab n="6"/>&lt;li&gt;&lt;a href="{$currentPage}"&gt;Browse&lt;/a&gt;<br />
+						<Tab n="7"/>&lt;ul&gt;<br />
+							<Tab n="8"/>&lt;xsl:call-template name="Browsing"/&gt;<br />
+						<Tab n="7"/>&lt;/ul&gt;<br />
+					<Tab n="6"/>&lt;/li&gt;<br />
+				<Tab n="5"/>&lt;/xsl:when&gt;<br />
+				<Tab n="5"/>&lt;xsl:otherwise&gt;<br />
+					<Tab n="6"/>&lt;xsl:call-template name="Browsing"/&gt;<br />
+				<Tab n="5"/>&lt;/xsl:otherwise&gt;<br />
+			<Tab n="4"/>&lt;/xsl:choose&gt;<br /><br />
+
+			<Tab n="4"/>&lt;xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'"&gt;<br />
+				<Tab n="5"/>&lt;li&gt;&lt;a href="{$currentPage}"&gt;Search&lt;/a&gt;<br />
+					<Tab n="6"/>&lt;ul&gt;<br />
+						<Tab n="7"/>&lt;xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']"&gt;<br />
+							<Tab n="8"/>&lt;xsl:variable name="search" select="@name"/&gt;<br />
+							<Tab n="8"/>&lt;xsl:variable name="search_name" select="displayItem[@name='name']"/&gt;<br />						
+							<Tab n="8"/>&lt;li&gt;&lt;a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"&gt;&lt;xsl:value-of select="$search_name"/&gt;&lt;/a&gt;&lt;/li&gt;<br />
+						<Tab n="7"/>&lt;/xsl:for-each&gt;<br />
+					<Tab n="6"/>&lt;/ul&gt;<br />
+				<Tab n="5"/>&lt;/li&gt;<br />
+			<Tab n="4"/>&lt;/xsl:if&gt;<br /><br />
+		<Tab n="3"/>&lt;/xsl:when&gt;<br />
+		<Tab n="3"/>&lt;xsl:otherwise&gt;  &lt;/xsl:otherwise&gt;<br />
+	<Tab n="2"/>&lt;/xsl:choose&gt;<br />
+<Tab n="1"/>&lt;/xsl:template&gt;<br /><br />
+
+<Tab n="1"/>&lt;xsl:template name="Browsing"&gt;<br/>
+	<Tab n="2"/>&lt;xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier"&gt;<br/>
+		<Tab n="3"/>&lt;li&gt;<br/>
+			<Tab n="4"/>&lt;xsl:choose&gt;<br/>
+			<Tab n="4"/>&lt;!-- If this tab is selected then colour it differently --&gt;<br/>
+				<Tab n="5"/>&lt;xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)"&gt;<br/>
+					<Tab n="6"/>&lt;xsl:attribute name='class'&gt;active&lt;/xsl:attribute&gt;<br/>
+				<Tab n="5"/>&lt;/xsl:when&gt;<br/>
+				<Tab n="5"/>&lt;xsl:otherwise&gt; &lt;/xsl:otherwise&gt;<br/>
+			<Tab n="4"/>&lt;/xsl:choose&gt;<br/><br/>
+							
+			<Tab n="4"/>&lt;a&gt;<br/>
+			<Tab n="4"/>&lt;!-- Add a title element to the &lt;a&gt; tag if a description exists for this classifier --&gt;<br/>
+				<Tab n="5"/>&lt;xsl:if test="displayItem[@name='description']"&gt;<br/>
+					<Tab n="6"/>&lt;xsl:attribute name='title'&gt;&lt;xsl:value-of select="displayItem[@name='description']"/&gt;&lt;/xsl:attribute&gt;<br/>
+				<Tab n="5"/>&lt;/xsl:if&gt;<br/><br/>
+								
+				<Tab n="5"/>&lt;!-- Add the href element to the &lt;a&gt; tag --&gt;<br/>
+				<Tab n="5"/>&lt;xsl:choose&gt;<br/>
+					<Tab n="6"/>&lt;xsl:when test="@name"&gt;<br/>
+						<Tab n="7"/>&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;/collection/&lt;xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/&gt;/browse/&lt;xsl:value-of select="@name"/&gt;&lt;/xsl:attribute&gt;<br/>
+					<Tab n="6"/>&lt;/xsl:when&gt;<br/>
+					<Tab n="6"/>&lt;xsl:otherwise&gt;<br/>
+						<Tab n="7"/>&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;/collection/&lt;xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/&gt;/browse/1&lt;/xsl:attribute&gt;<br/>
+					<Tab n="6"/>&lt;/xsl:otherwise&gt;<br/>
+				<Tab n="5"/>&lt;/xsl:choose&gt;<br/><br/>
+				
+				<Tab n="5"/>&lt;!-- Add the actual text of the &lt;a&gt; tag --&gt;<br/>
+				<Tab n="5"/>&lt;xsl:value-of select="displayItem[@name='name']"/&gt;<br/>
+			<Tab n="4"/>&lt;/a&gt;<br/>
+		<Tab n="3"/>&lt;/li&gt;<br/>
+	<Tab n="2"/>&lt;/xsl:for-each&gt;<br/>
+<Tab n="1"/>&lt;/xsl:template&gt;<br/>		
+</Format><Comment>
+<Text id="ni3-c2">A basic explanation of these templates follows (don't worry if you don't understand it). You can skip ahead to Step 9 if you'd like.</Text>
+</Comment>
+<Text id="ni3-16">Let's take a look at the <b>navBar</b> template and try to understand what it's doing. First, it's checking to see if the page is a collection page (<Format>&lt;xsl:when test="page/pageResponse/collection"&gt;</Format>). If so, it will create a link back to the home page (<Format>&lt;li&gt;&lt;a href="{$library_name}"&gt;Home&lt;/a&gt;&lt;/li&gt;</Format>) and to the current collection's about page.</Text>
+<Text id="ni3-17">Then, if there are 3 or fewer browsing classifiers, they will each become a link on the navigation bar. If there are more than 3 browsing classifiers, then they will be made into a dropdown menu under the heading "Browse". (If there are too many links in the navigation bar, they will start to overlap.) Finally, if there are any search types, they will be in a dropdown menu under the heading "Search". In addition, it adds the attribute "class=active" to the link for the current page so that it will be colored differently. </Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-18">Save <b>main.xsl</b> and refresh the browser. The home page should have no links in the navigation bar at all. Enter a few different collection and see what the navigation bar looks like in each of those.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni3-h3">Adding functionality to the quick search box</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni3-19">Currently, the quick search box doesn't actually work. To make the quick search work, replace this:</Text>
+<Format>
+				<Tab n="4"/>&lt;div id="search"&gt;<br/>
+					<Tab n="5"/>&lt;form action="#" method="post"&gt;<br/>
+						<Tab n="6"/> &lt;fieldset&gt;<br/>
+							<Tab n="7"/>&lt;legend&gt;Site Search&lt;/legend&gt;<br/>
+							<Tab n="7"/>&lt;input type="text" value="Search Our Website&#8230;"  onfocus="this.value=(this.value=='Search Our Website&#8230;')? '' : this.value ;" /&gt;<br/>
+							<Tab n="7"/>&lt;input type="submit" name="go" id="go" value="Search" /&gt;<br/>
+						<Tab n="6"/>&lt;/fieldset&gt;<br/>
+					<Tab n="5"/>&lt;/form&gt;<br/>					
+				<Tab n="4"/>&lt;/div&gt;<br/>	  
+				<Tab n="4"/>&lt;br class="clear" /&gt;<br/>
+				<Tab n="4"/>&lt;div id="advanced"&gt;&lt;a href="#"&gt;advanced search&lt;/a&gt;&lt;/div&gt;<br/>	
+</Format>
+<Text id="ni3-20">With this:</Text>
+<Format>
+			<Tab n="4"/>&lt;xsl:choose&gt;<br/>
+				<Tab n="5"/>&lt;xsl:when test="page/pageRequest/@subaction='home'"&gt;<br/>
+					<Tab n="6"/>&lt;xsl:call-template name="crossCollSearch"/&gt;<br/>
+				<Tab n="5"/>&lt;/xsl:when&gt;<br/>
+				<Tab n="5"/>&lt;xsl:when test="page/pageRequest/paramList/param/@name='c' and /page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']"&gt;<br/>
+					<Tab n="6"/>&lt;xsl:call-template name="CollectionSearch"/&gt;<br/>
+				<Tab n="5"/>&lt;/xsl:when&gt;<br/>
+				<Tab n="5"/>&lt;xsl:otherwise/&gt;<br/>
+			<Tab n="4"/>&lt;/xsl:choose&gt;<br/>
+</Format>
+<Text id="ni3-21">This says when you are on the home page, use the <b>crossCollSearch</b> template; when you are on a collection page (and that collection has <b>plain</b>, i.e. "TextQuery", search enabled), use the <b>CollectionSearch</b> template; otherwise, don't put anything at all.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-22">Now add in the <b>crossCollSearch</b> and <b>CollectionSearch</b> templates before the final <Format>&lt;/xsl:stylesheet&gt;</Format>:</Text>
+<Format>
+<Tab n="1"/>&lt;xsl:template name="crossCollSearch"&gt;<br/>
+<Tab n="2"/>&lt;div id="search"&gt;<br/>
+	<Tab n="3"/>&lt;xsl:for-each select="/page/pageResponse/serviceList/service[@name='TextQuery']"&gt;<br/>
+		<Tab n="4"/>&lt;form name="QuickSearch" method="get" action="{$library_name}"&gt;<br/>
+			<Tab n="5"/>&lt;input type="hidden" name="a" value="q"/&gt;<br/>
+			<Tab n="5"/>&lt;input type="hidden" name="rt" value="rd"/&gt;<br/>
+			<Tab n="5"/>&lt;input type="hidden" name="s" value="{@name}"/&gt;<br/>
+			<Tab n="5"/>&lt;input type="hidden" name="s1.collection" value="all"/&gt;<br/>
+			<Tab n="5"/>&lt;input type="text" name="s1.query" id="search-text" value="Search all collections&#8230;"  onfocus="this.value=(this.value=='Search all collections&#8230;')? '' : this.value ;" /&gt;<br/>
+			<Tab n="5"/>&lt;input type="submit" name="go" id="go" value="Search" /&gt;<br/>
+		<Tab n="4"/>&lt;/form&gt;<br/>
+	<Tab n="3"/>&lt;/xsl:for-each&gt; <br/>
+<Tab n="2"/>&lt;/div&gt;<br/>
+<Tab n="2"/>&lt;br class="clear" /&gt; 	  <br/>
+<Tab n="1"/>&lt;/xsl:template&gt;<br/><br/>
+
+<Tab n="1"/>&lt;xsl:template name="CollectionSearch"&gt;<br/>
+<Tab n="2"/>&lt;div id="search"&gt;<br/>
+	<Tab n="3"/>&lt;xsl:variable name="subaction" select="/page/pageRequest/@subaction"/&gt;	<br/>
+				<Tab n="3"/>&lt;form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery"&gt;<br/>
+						<Tab n="4"/>&lt;!-- This parameter says that we have come from the quick search area --&gt;<br/>
+						<Tab n="4"/>&lt;input type="hidden" name="qs" value="1"/&gt;<br/>
+						<Tab n="4"/>&lt;input type="hidden" name="rt" value="rd"/&gt;<br/>
+						<Tab n="4"/>&lt;input type="hidden" name="s1.level"&gt;<br/>
+							<Tab n="5"/>&lt;xsl:attribute name="value"&gt;<br/>
+								<Tab n="6"/>&lt;xsl:choose&gt;<br/>
+									<Tab n="7"/>&lt;xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']"&gt;<br/>
+										<Tab n="8"/>&lt;xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/&gt;<br/>
+									<Tab n="7"/>&lt;/xsl:when&gt;<br/>
+									<Tab n="7"/>&lt;xsl:otherwise&gt;<br/>
+									    <Tab n="8"/>&lt;xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/&gt;<br/>
+									<Tab n="7"/>&lt;/xsl:otherwise&gt;<br/>
+								<Tab n="6"/>&lt;/xsl:choose&gt;<br/>
+							<Tab n="5"/>&lt;/xsl:attribute&gt;<br/>
+						<Tab n="4"/>&lt;/input&gt;<br/>
+						<Tab n="4"/>&lt;xsl:choose&gt;<br/>
+							<Tab n="5"/>&lt;xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']"&gt;<br/>
+								<Tab n="6"/>&lt;input type="hidden" name="s1.startPage" value="1"/&gt;<br/>
+							<Tab n="5"/>&lt;/xsl:when&gt;<br/>
+							<Tab n="5"/>&lt;xsl:otherwise&gt;<br/>
+							<Tab n="6"/>	&lt;input type="hidden" name="startPage" value="1"/&gt;<br/>
+							<Tab n="5"/>&lt;/xsl:otherwise&gt;<br/>
+						<Tab n="4"/>&lt;/xsl:choose&gt;<br/>
+						<Tab n="4"/>&lt;xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])"&gt;<br/>
+							<Tab n="5"/>&lt;input type="hidden" name="s1.hitsPerPage" value="20"/&gt;<br/>
+						<Tab n="4"/>&lt;/xsl:if&gt;<br/>
+						<Tab n="4"/>&lt;xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])"&gt;<br/>
+							<Tab n="5"/>&lt;input type="hidden" name="s1.maxDocs" value="100"/&gt;<br/>
+						<Tab n="4"/>&lt;/xsl:if&gt;<br/>
+						<Tab n="4"/>&lt;!-- The query text box --&gt;<br/>
+						<Tab n="4"/>&lt;span class="querybox"&gt;<br/>
+							<Tab n="5"/>&lt;xsl:variable name="qs"&gt;<br/>
+								<Tab n="6"/>&lt;xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/&gt;<br/>
+							<Tab n="5"/>&lt;/xsl:variable&gt;<br/>
+							<Tab n="5"/>&lt;nobr&gt;<br/>
+							<Tab n="5"/>&lt;xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']"&gt;<br/>
+								<Tab n="6"/>&lt;xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/&gt;<br/>
+							<Tab n="5"/>&lt;/xsl:apply-templates&gt;<br/>
+							<Tab n="5"/>&lt;/nobr&gt;<br/>
+						<Tab n="4"/>&lt;/span&gt;<br/>
+						<Tab n="4"/>&lt;!-- The submit button (for TextQuery) --&gt;<br/>
+						<Tab n="4"/>&lt;xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']"&gt;<br/>
+							<Tab n="5"/>&lt;input type="submit" name="go" id="go" value="Search" &gt; &lt;/input&gt;<br/>
+							<Tab n="5"/>&lt;br/&gt;<br/>
+						<Tab n="4"/>&lt;/xsl:if&gt;<br/>
+		<Tab n="3"/>&lt;/form&gt;		<br/>
+	<Tab n="2"/> &lt;/div&gt;<br/>
+    <Tab n="2"/>&lt;br class="clear" /&gt; <br/>
+	<Tab n="2"/>&lt;div id="advanced"&gt;&lt;a href="{$library_name}/collection/{$collNameChecked}/search/TextQuery"&gt;advanced search&lt;/a&gt;&lt;/div&gt;<br/>	
+<Tab n="1"/>&lt;/xsl:template&gt;	<br/>
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-23">Save <b>main.xsl</b> and refresh the web browser. Try searching for a word on the home page (like "economy"), and then enter a collection or two and try searching from there, as well.</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni3-h4">Adding the library name and login links</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni3-24">Next, we'll add a header to our page that displays the library's name (with a link to the home page), and, if we're inside a collection, displays the collection's name (with a link to the collection's about page). After the <Format>&lt;body&gt;</Format> tag in <b>mainTemplate</b>, add the following:</Text>
+<Format>
+			<Tab n="4"/>&lt;div class="fl_left"&gt;<br />
+				<Tab n="5"/>&lt;h1&gt;&lt;a href="{$library_name}"&gt;&lt;xsl:call-template name="siteName"/&gt;&lt;/a&gt;&lt;/h1&gt;<br />
+				<Tab n="5"/>&lt;p&gt;&#160;<br />
+				<Tab n="6"/>&lt;xsl:if test="page/pageResponse/collection"&gt;<br />
+					<Tab n="7"/>&lt;a href="{$library_name}/collection/{$collNameChecked}/page/about"&gt;<br />
+						<Tab n="8"/>&lt;xsl:value-of select="page/pageResponse/collection/displayItem[@name='name']"/&gt;<br />
+					<Tab n="7"/>&lt;/a&gt;<br />
+				<Tab n="6"/>&lt;/xsl:if&gt;<br />
+				<Tab n="5"/>&lt;/p&gt;<br />
+			<Tab n="4"/>&lt;/div&gt;<br />
+</Format>
+<Text id="ni3-25">Save main.xsl and refresh the web browser to see the library name display at the top of the page. Enter a collection to see the collection name displayed.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-26">Finally, we will add the top bar which includes the links for logging in, the help page, and the preferences page. In the <b>mainTemplate</b>, <b>replace</b> the <Format>&lt;body&gt;</Format> tag with: </Text>
+<Format>
+<Tab n="3"/>&lt;body id="top"&gt;<br />
+<Tab n="4"/>&lt;div class="wrapper col0"&gt;<br />
+  <Tab n="5"/>&lt;div id="topline"&gt;<br />
+    <Tab n="6"/>&lt;ul&gt;<br />
+ 	<Tab n="7"/>&lt;call-template name="loginLinks"/&gt;<br />
+     <Tab n="7"/> &lt;li&gt;&lt;a href="{$library_name}/collection/{$collNameChecked}/page/pref"&gt;Preferences&lt;/a&gt;&lt;/li&gt;<br />
+     <Tab n="7"/> &lt;li&gt;&lt;a href="{$library_name}/collection/{$collNameChecked}/page/help"&gt;Help&lt;/a&gt;&lt;/li&gt;<br />
+    <Tab n="6"/>&lt;/ul&gt;<br />
+   <Tab n="6"/> &lt;br class="clear" /&gt;<br />
+  <Tab n="5"/>&lt;/div&gt;<br />
+<Tab n="4"/>&lt;/div&gt;<br />
+</Format>
+<Text id="ni3-27">and add the following template before the final <Format>&lt;/xsl:stylesheet&gt;</Format>:</Text>
+<Format>
+<Tab n="1"/>&lt;xsl:template name="loginLinks"&gt;<br />
+<Tab n="2"/>&lt;xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/&gt;<br />
+<Tab n="2"/>&lt;xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/&gt;<br /><br />
+
+<Tab n="2"/>&lt;xsl:choose&gt;<br />
+	<Tab n="3"/>&lt;xsl:when test="$username"&gt;<br />
+		<Tab n="4"/>&lt;xsl:if test="contains($groups,'admin')"&gt;<br />
+		<Tab n="5"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/AddUser"&gt;Add user&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="5"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="4"/>&lt;/xsl:if&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;&lt;a href="{$library_name}/admin/AccountSettings?s1.username={$username}"&gt;Logged in as: &lt;xsl:value-of select="$username"/&gt;&lt;/a&gt;&lt;/li&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;&lt;a href="{$library_name}?logout="&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
+	<Tab n="3"/>&lt;/xsl:when&gt;<br />
+	<Tab n="3"/>&lt;xsl:otherwise&gt;<br />
+		<Tab n="4"/>&lt;li class="login"&gt;<br />
+			<Tab n="5"/>&lt;a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home"&gt;Login<br/>
+				<Tab n="6"/>&lt;xsl:attribute name="title"&gt;<br/>
+					<Tab n="7"/>&lt;xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/&gt;<br/>
+				<Tab n="6"/>&lt;/xsl:attribute&gt;<br/>
+			<Tab n="5"/>&lt;/a&gt;<br />
+		<Tab n="4"/>&lt;/li&gt;<br />
+	<Tab n="3"/>&lt;/xsl:otherwise&gt;<br />
+<Tab n="2"/>&lt;/xsl:choose&gt;<br />
+<Tab n="1"/>&lt;/xsl:template&gt;<br />
+</Format>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-27">Save and close <b>main.xsl</b> and refresh the web browser too see the top bar. Click the <b>Login</b> button and log in as <b>admin</b> (default password is "admin") to see all of the links appear along the top (including links to the <b>Add User</b> page, to the <b>Administration</b> page, and to Logout).</Text>
+</NumberedItem>
+<Heading>
+<Text id="ni3-h5">Interface language files</Text>
+</Heading>
+<NumberedItem>
+<Text id="ni3-28">In the web browser, click the <b>Help</b> button. For simplicity's sake, we have not built this interface to be language independent. All of the text is simply written in English. The content of the help page, however, which is still being "borrowed" from the default interface, is built to be language independent.</Text>
+<Text id="ni3-29"> However, the <b>help.xsl</b> file in <b>default</b> is looking for a file called <Format>interface_&lt;interface-name&gt;2.properties</Format>. So, when the <b>default</b> interface is being used, it will look for the file <Format>interface_default2.properties</Format>, which does exist. But since our library is using the <b>perrin</b> interface, it is looking for the file <Format>interface_perrin2.properties</Format>, which does <i>not</i> exist. There are a few different solutions to this. The quickest solution at the moment is to create an <Format>interface_perrin2.properties</Format> file so that the English values will display.</Text>
+</NumberedItem>
+<NumberedItem>
+<Text id="ni3-30">In the <Path>Greenstone3 &rarr; web &rarr; WEB-INF &rarr; classes</Path> folder, create a copy of the <Format>interface_default2.properties</Format> file (select the file and press <b>Ctrl+C</b> then <b>Ctrl+V</b>). This will create a file called <Format>interface_default2 - Copy.properties</Format>. Rename this file <Format>interface_perrin2.properties</Format>. </Text>
+<Text id="ni3-31">When adding or editing properties files, you must restart the server for changes to take effect. In the Greenstone Server window, click the <b>Restart Library</b> button. When the server restarts, navigate to <Path>http://localhost:8383/greenstone3/golden/collection//page/help</Path> to see the English help text properly displayed.</Text>
+</NumberedItem>
+</Content>
+</Tutorial>
 </MajorVersion>
 </TutorialList>
