source: documentation/trunk/tutorial_sample_files/custom/gs3-homepage.txt@ 27885

Last change on this file since 27885 was 27885, checked in by jlwhisler, 11 years ago

Made minor changes to fix issues Anu encountered when running through home page tutorial -- fixed user registration link; added escape characters; changed the search box template because the search button stretched outside the column boundaries.

File size: 2.1 KB
Line 
1Step 8:
2
3<xsl:template name="collectionsList">
4<xsl:for-each select="./page/pageResponse/collectionList/collection">
5<xsl:variable name="collectionName" select="@name"/>
6<li>
7<a href="library/collection/{$collectionName}/page/about">
8<xsl:value-of select="displayItem[@name='name']"/>
9</a>
10</li>
11</xsl:for-each>
12</xsl:template>
13
14
15Step 9:
16
17<xsl:call-template name="collectionsList"/>
18
19Step 11:
20
21<xsl:template name="searchBox">
22<xsl:for-each select="//page/pageResponse/serviceList/service[@name='TextQuery']">
23<form name="QuickSearch" method="get" action="{$library_name}">
24<input type="hidden" name="a" value="q"/>
25<input type="hidden" name="rt" value="rd"/>
26<input type="hidden" name="s" value="{@name}"/>
27<input type="hidden" name="s1.collection" value="all"/>
28<input type="text" name="s1.query" size="20" id="search-text" value="" />
29<input type="submit" id="search-submit">
30<xsl:attribute name="value">
31<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/>
32</xsl:attribute>
33</input>
34</form>
35</xsl:for-each>
36</xsl:template>
37
38
39Step 12:
40
41<xsl:call-template name="searchBox"/>
42
43
44Step 15:
45
46<xsl:template name="loginButton">
47<xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
48<xsl:choose>
49<xsl:when test="$username">
50<li><a>
51<xsl:attribute name="href">library/admin/AccountSettings?s1.username=<xsl:value-of select="$username"/></xsl:attribute><xsl:value-of select="$username"/>
52</a></li>
53<li><a href="library/admin/AddUser">Register a new user</a></li>
54<li><a href="library/admin/ListUsers">Administration</a></li>
55<li><a><xsl:attribute name="href">library?logout=</xsl:attribute>Logout</a></li>
56</xsl:when>
57<xsl:otherwise>
58<li><a href="?a=p&amp;sa=login&amp;redirectURL=library%3Fa=p%26sa=home">Login
59<xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/></xsl:attribute>
60
61</a></li>
62</xsl:otherwise>
63</xsl:choose>
64</xsl:template>
65
66Step 16:
67
68<xsl:call-template name="loginButton"/>
69
70Step 18:
71
72<xsl:call-template name="siteName"/>
Note: See TracBrowser for help on using the repository browser.