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

Last change on this file since 34582 was 34582, checked in by anupama, 3 years ago

Updates and new interface.txt file with code snippets for the final 3 customisation tutorials. Not sure why we didn't already have one. By copying directly from the tutorial html, I may not have noticed there was no text file containing all the prepared code snippets to paste into the various xsl files.

File size: 2.3 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_name}/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:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
49
50<xsl:choose>
51<xsl:when test="$username">
52<xsl:if test="contains($groups,'admin')">
53<li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li>
54<li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
55</xsl:if>
56<li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
57<li class="login"><a href="{$library_name}?logout=">Logout</a></li>
58</xsl:when>
59<xsl:otherwise>
60<li class="login">
61<a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
62<xsl:attribute name="title">
63<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
64</xsl:attribute>
65</a>
66</li>
67</xsl:otherwise>
68</xsl:choose>
69</xsl:template>
70
71Step 16:
72
73<xsl:call-template name="loginButton"/>
74
75Step 18:
76
77<xsl:call-template name="siteName"/>
Note: See TracBrowser for help on using the repository browser.