source: main/trunk/model-interfaces-dev/wmtb/transform/pages/home.xsl@ 34277

Last change on this file since 34277 was 34277, checked in by ak19, 4 years ago

Anita and Renee had prepared a Digital Library home page. Have added its text into the actual home.xsl. Some pou were further renamed

File size: 9.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
11
12 <!-- use the 'main' layout -->
13 <!--<xsl:include href="layouts/main.xsl"/>-->
14
15 <!-- set page title -->
16 <xsl:template name="pageTitle"><xsl:choose><xsl:when test="$groupPath != ''"><gslib:groupName path="{$groupPath}"/></xsl:when><xsl:otherwise><gslib:siteName/></xsl:otherwise></xsl:choose></xsl:template>
17
18 <!-- set page breadcrumbs -->
19 <xsl:template name="breadcrumbs">
20 <xsl:if test="$groupPath != ''">
21 <gslib:siteLink/>
22 <xsl:for-each select="/page/pageResponse/pathList/group">
23 <xsl:sort data-type="number" select="@position"/>
24 <gslib:rightArrow/>
25 <xsl:if test="position() != last()">
26 <!-- don't want the current group in the breadcrumbs -->
27 <a>
28 <xsl:attribute name="href"><gslib:groupHref path="{@path}"/></xsl:attribute>
29 <xsl:attribute name="title"><gslib:groupName path="{@path}"/></xsl:attribute>
30 <gslib:groupName path="{@path}"/>
31 </a>
32 </xsl:if>
33 </xsl:for-each>
34 </xsl:if>
35 </xsl:template>
36
37 <!-- the page content -->
38 <xsl:template match="/page/pageResponse">
39 <div class="main-wrap">
40 <div id="wsite-content" class="wsite-elements wsite-not-footer">
41 <div class="wsite-section-wrap">
42 <div class="wsite-section wsite-body-section wsite-background-14" >
43 <div class="wsite-section-content">
44 <div class="container">
45 <div class="wsite-section-elements">
46 <xsl:if test="groupList/group">
47 <div class="paragraph" style="text-align:center;">
48<div class="paragraph" style="text-align:center;">Our purpose is <strong style="color:rgb(63, 63, 63)"><em>&#x201C;Kia rangatira ai ngā uri o te Whakatōhea&#x201D; &#150; &#x201C;To lift our nation, and to grow and invest in the well-being of our people&#x201D;.</em></strong><br /><span style="color:rgb(63, 63, 63)">The Whakatōhea Māori Trust Board</span> exists to improve the lives of its people <br />through the six <em><strong>&#x201C;50-year Strategic Goals&#x201D;</strong></em> these are defined as the following <strong>Six Pou:</strong> <br /></div>
49 </div>
50 </xsl:if>
51 <!-- forced to add nbsp (which in XSL is &#160;) in div.wsite-spacer
52 because otherwise text overflows from the main page into footer
53 caused by html rendering of div.wsite-spacer's subsequent sibling
54 divs as *children* of div.wsite-spacer instead.
55 Beware that XSL errors ensue if &nbsp; is used as it's not a defined
56 entity in XSL, only in HTML. Must use &#160; for nbsp in XSL, see
57 https://stackoverflow.com/questions/1461649/how-to-insert-nbsp-in-xslt
58 -->
59 <div class="wsite-spacer" style="height:50px;">
60 &#160; &#160; &#160;
61 </div>
62 <div><div class="wsite-multicol"><div class="wsite-multicol-table-wrap" style="margin:0 -15px;">
63 <table class="wsite-multicol-table">
64 <tbody class="wsite-multicol-tbody">
65 <tr class="wsite-multicol-tr">
66 <xsl:call-template name="collectionAndGroupLinks"/>
67 </tr>
68 </tbody>
69 </table>
70 </div></div></div>
71 </div>
72 </div>
73 </div>
74
75 </div>
76 </div>
77
78 </div>
79 </div><!-- end class main-wrap-->
80 </xsl:template>
81
82 <xsl:template name="additionalHeaderContent">
83 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"><xsl:text> </xsl:text></script>
84 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"><xsl:text> </xsl:text></script>
85 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"><xsl:text> </xsl:text></script>
86 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"><xsl:text> </xsl:text></script>
87 </xsl:template>
88
89 <xsl:template name="collectionsList">
90 <!-- for every collection in the library -->
91 <xsl:for-each select="./collectionList/collection">
92 <xsl:call-template name="collDescription"/>
93 </xsl:for-each>
94 </xsl:template>
95
96 <xsl:template name="collDescription">
97 <xsl:variable name="collectionFolder" select="@name"/>
98 <xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
99 <xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='icon']"/>
100 <xsl:variable name="homeImage" select="displayItemList/displayItem[@name='smallicon']"/>
101 <xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/>
102 <xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/>
103 <!-- creates a header that links to the collection's about page -->
104
105 <!-- if there is an About page image for the collection, this is displayed -->
106 <xsl:if test="$homeImage">
107 <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center">
108 <img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$homeImage}" alt="{$collectionName}" title="{$collectionName}" style="max-width:100%" />
109 </div></div>
110 <div style="display:block;font-size:90%"></div>
111 </xsl:if>
112
113 <!-- don't centre collection description (div class=paragraph)
114 with style="text-align:center;
115 since the collection description may be HTML in its own right -->
116 <div class="paragraph">
117 <a href="{$library_name}/collection/{$collectionFolder}/page/about" title="{$collectionName}" alt="{$collectionName}"><xsl:value-of select="$collectionName"/></a>
118 <br />
119 <xsl:choose>
120 <!-- has a description - display it -->
121 <xsl:when test="$collDesc">
122
123 <!--<xsl:value-of select="$collDesc" disable-output-escaping="yes"/>--><xsl:apply-templates select="displayItemList/displayItem[@name='description']"/>
124 </xsl:when>
125 <!-- no description - a generic sentence -->
126 <xsl:otherwise>
127 <p class="justify">Welcome to the <xsl:value-of select="$collectionName"/> collection. This collection contains <xsl:value-of select="$numDocs"/> documents.</p>
128 </xsl:otherwise>
129 </xsl:choose>
130 </div>
131 </xsl:template>
132
133 <xsl:template name="collectionAndGroupLinks">
134 <xsl:for-each select="collectionList/collection|groupList/group">
135 <xsl:sort data-type="number" select="@position"/>
136 <td class="wsite-multicol-col" style="width:33.333333333333%; padding:0 15px;">
137 <xsl:if test="name() = 'collection'">
138 <xsl:call-template name="collDescription"/>
139 </xsl:if>
140 <xsl:if test="name() = 'group'">
141 <xsl:call-template name="customGroupDescription"/>
142 </xsl:if>
143 </td>
144 </xsl:for-each>
145
146 </xsl:template>
147 <xsl:template match="/page/xsltparams">
148 <!-- suppress xsltparam block in page -->
149 </xsl:template>
150
151 <!-- Modified version of <gslib:groupLinkWithImage/>-->
152 <xsl:template name="customGroupDescription">
153 <xsl:variable name="short"><xsl:value-of select="shortDescription"/></xsl:variable>
154 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable>
155 <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>/group/<xsl:if test="/page/pageRequest/paramList/param[@name='group']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/</xsl:if><xsl:value-of select="@name"/></xsl:variable>
156
157
158 <!-- if there is an image for this group, this is displayed -->
159 <xsl:if test="util:checkFileExistence($site_name, backgroundImage)">
160 <div><div class="wsite-image wsite-image-border-thin " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center">
161 <img class="groupLinkImage">
162 <xsl:attribute name="alt"><xsl:value-of select="@name"/></xsl:attribute>
163 <xsl:attribute name="title"><xsl:value-of select="@name"/></xsl:attribute>
164 <xsl:attribute name="style"><xsl:text>max-width:100%</xsl:text></xsl:attribute>
165 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/<xsl:value-of select="backgroundImage"/></xsl:attribute>
166 </img>
167 </div></div>
168 <div style="display:block;font-size:90%"></div>
169 </xsl:if>
170
171 <!-- some text for the group -->
172 <div class="paragraph" style="text-align:center;">
173 <!-- group title links to the collection's about page -->
174 <a href="{$group_href}" title="{$short}" alt="{$short}">
175 <xsl:choose>
176 <xsl:when test="boolean(title)">
177 <xsl:value-of select="title"/>
178 </xsl:when>
179 <xsl:otherwise>
180 <xsl:value-of select="@name"/>
181 </xsl:otherwise>
182 </xsl:choose>
183 </a>
184 <br />
185 <xsl:choose>
186 <!-- If the group has a description - display it -->
187 <xsl:when test="$desc">
188 <xsl:value-of select="$desc" disable-output-escaping="yes"/>
189 </xsl:when>
190 <!-- If no group description - repeat group name -->
191 <xsl:otherwise>
192 Collection group: <xsl:value-of select="@name" disable-output-escaping="yes"/>
193 </xsl:otherwise>
194 </xsl:choose>
195 </div>
196
197 </xsl:template>
198
199</xsl:stylesheet>
200
201
Note: See TracBrowser for help on using the repository browser.