source: main/trunk/model-interfaces-dev/opotiki/transform/pages/home.xsl@ 34087

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

Cher (Chai Lin): Adding the Opotiki interface.

File size: 3.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 <!-- the page content -->
11 <xsl:template match="/page/pageResponse">
12 <div class="content">
13 <xsl:for-each select="./collectionList/collection">
14 <xsl:variable name="collectionFolder" select="@name"/>
15 <xsl:variable name="homeImage">
16 <xsl:choose>
17 <xsl:when test="displayItem[@name='smallicon']">
18 sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="$collectionFolder"/>/images/<xsl:value-of select="displayItem[@name='smallicon']"/>
19 </xsl:when>
20 <xsl:otherwise>
21 interfaces/<xsl:value-of select="$interface_name"/>/images/default.jpg
22 </xsl:otherwise>
23 </xsl:choose>
24 </xsl:variable>
25
26
27 </xsl:for-each>
28 <img src="interfaces/perrin/images/default.jpg" alt="" />
29 </div>
30 <div class="column">
31 <ul class="latestnews">
32 <li>
33 <p><strong><a href="#">Highlighted Item 1</a></strong><br/>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.</p>
34 </li>
35 <li>
36 <p><strong><a href="#">Highlighted Item 2</a></strong><br/>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.</p>
37 </li>
38
39 </ul>
40 </div>
41 <br class="clear" />
42 <div id="hpage_cats">
43 <xsl:call-template name="collectionsList"/>
44 </div>
45 </xsl:template>
46
47
48 <xsl:template name="additionalHeaderContent">
49 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"><xsl:text> </xsl:text></script>
50 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"><xsl:text> </xsl:text></script>
51 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"><xsl:text> </xsl:text></script>
52 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"><xsl:text> </xsl:text></script>
53 </xsl:template>
54
55 <xsl:template name="collectionsList">
56 <!-- for every collection in the library -->
57 <xsl:for-each select="./collectionList/collection">
58 <xsl:call-template name="collDescription"/>
59 </xsl:for-each>
60 </xsl:template>
61
62 <xsl:template name="collDescription">
63 <xsl:variable name="collectionFolder" select="@name"/>
64 <xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
65 <xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='icon']"/>
66 <xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/>
67 <xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/>
68 <!-- creates a header that links to the collection's about page -->
69 <h2><a href="{$library_name}/collection/{$collectionFolder}/page/about"><xsl:value-of select="$collectionName"/></a></h2>
70 <!-- if there is an About page image for the collection, this is displayed -->
71 <xsl:if test="$aboutImage">
72 <img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$aboutImage}" alt="{$collectionName}" />
73 </xsl:if>
74
75 <xsl:choose>
76 <!-- has a description - display it -->
77 <xsl:when test="$collDesc">
78 <p class="justify"><xsl:value-of select="$collDesc" disable-output-escaping="yes"/></p>
79 </xsl:when>
80 <!-- no description - a generic sentence -->
81 <xsl:otherwise>
82 <p class="justify">Welcome to the <xsl:value-of select="$collectionName"/> collection. This collection contains <xsl:value-of select="$numDocs"/> documents.</p>
83 </xsl:otherwise>
84 </xsl:choose>
85 </xsl:template>
86</xsl:stylesheet>
87
88
Note: See TracBrowser for help on using the repository browser.