Changeset 34237 for main/trunk
- Timestamp:
- 2020-07-02T05:14:55+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/opotiki/transform/pages/home.xsl
r34211 r34237 8 8 exclude-result-prefixes="java util"> 9 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 10 37 <!-- the page content --> 11 38 <xsl:template match="/page/pageResponse"> 12 <div class="content"> 39 <!--<h2><gslib:selectACollectionTextBar/></h2>--> 40 41 42 <div class="content"> 43 <!-- 13 44 <xsl:for-each select="./collectionList/collection"> 14 45 <xsl:variable name="collectionFolder" select="@name"/> … … 26 57 27 58 </xsl:for-each> 59 --> 28 60 <img src="interfaces/perrin/images/default.jpg" alt="" /> 29 61 </div> … … 41 73 <br class="clear" /> 42 74 <div id="hpage_cats"> 43 <xsl:call-template name="collectionsList"/> 75 <xsl:call-template name="collectionAndGroupLinks"/> 76 <!--<xsl:call-template name="collectionsList"/>--> 44 77 </div> 45 78 </xsl:template> … … 85 118 </xsl:choose> 86 119 </xsl:template> 120 121 <xsl:template name="collectionAndGroupLinks"> 122 <xsl:for-each select="collectionList/collection|groupList/group"> 123 <xsl:sort data-type="number" select="@position"/> 124 <xsl:if test="name() = 'collection'"> 125 <xsl:call-template name="collDescription"/> 126 <!--<xsl:call-template name="collectionLinkWithImage2"/>--> 127 <!--<gslib:collectionLinkWithImage/>--> 128 </xsl:if> 129 <xsl:if test="name() = 'group'"> 130 <xsl:call-template name="customGroupDescription"/> 131 <!--<gslib:groupLinkWithImage/>--> 132 </xsl:if> 133 </xsl:for-each> 134 135 </xsl:template> 136 <xsl:template match="/page/xsltparams"> 137 <!-- suppress xsltparam block in page --> 138 </xsl:template> 139 140 <!-- Modified version of <gslib:groupLinkWithImage/>--> 141 <xsl:template name="customGroupDescription"> 142 <xsl:variable name="short"><xsl:value-of select="shortDescription"/></xsl:variable> 143 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable> 144 <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> 145 146 <!-- creates a header that links to the collection's about page --> 147 <!--group: <xsl:value-of select="@name"/>--> 148 <h2> 149 <a href="{$group_href}" title="{$short}"> 150 <xsl:choose> 151 <xsl:when test="boolean(title)"> 152 <xsl:value-of select="title"/> 153 </xsl:when> 154 <xsl:otherwise> 155 <xsl:value-of select="@name"/> 156 </xsl:otherwise> 157 </xsl:choose> 158 </a> 159 </h2> 160 161 <!-- if there is an image for this group, this is displayed --> 162 <xsl:choose> 163 <xsl:when test="util:checkFileExistence($site_name, backgroundImage)"> 164 <img class="groupLinkImage"> 165 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute> 166 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/<xsl:value-of select="backgroundImage"/></xsl:attribute> 167 </img> 168 </xsl:when> 169 </xsl:choose> 170 171 <xsl:choose> 172 <!-- If the group has a description - display it --> 173 <xsl:when test="$desc"> 174 <p class="justify"><xsl:value-of select="$desc" disable-output-escaping="yes"/></p> 175 </xsl:when> 176 <!-- If no group description - repeat group name --> 177 <xsl:otherwise> 178 <p class="justify">Collection group: <xsl:value-of select="@name" disable-output-escaping="yes"/></p> 179 </xsl:otherwise> 180 </xsl:choose> 181 </xsl:template> 182 183 <!-- Copied from <gslib:collectionLinkWithImage/>. Not used. 184 See Jenny's template for collDescription. 185 The coll_href var may become important if something doesn't work in existing 186 collDescription. 187 For now though, there is no /page/pageRequest/paramList/param name=group 188 --> 189 <!-- 190 <xsl:template name="collDescription"> 191 <xsl:variable name="desc"><xsl:value-of select="displayItemList/displayItem[@name='shortDescription']"/></xsl:variable> 192 <xsl:variable name="coll_href"><xsl:value-of select="$library_name"/>/collection/<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"/>/page/about<xsl:choose><xsl:when test="libraryParamList/param">?<xsl:for-each select="libraryParamList/param"><xsl:value-of select="@name"/>=<xsl:value-of select="@default"/>&</xsl:for-each></xsl:when></xsl:choose></xsl:variable> 193 <xsl:choose> 194 <xsl:when test="displayItemList/displayItem[@name='smallicon']"> 195 <a href="{$coll_href}" title="{$desc}"> 196 <img class="collectionLinkImage"> 197 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute> 198 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItemList/displayItem[@name='smallicon']"/></xsl:attribute> 199 </img> 200 </a> 201 </xsl:when> 202 <xsl:otherwise> 203 <a href="{$coll_href}" title="{$desc}"> 204 <div class="collectionLink ui-corner-all"> 205 <div class="collectionLinkText ui-widget-content ui-corner-top"> 206 <xsl:choose><xsl:when test="displayItemList/displayItem[@name='name']"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:when> 207 <xsl:otherwise> 208 <xsl:value-of select="@name"/> 209 </xsl:otherwise> 210 </xsl:choose> 211 212 </div> 213 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div> 214 </div> 215 </a> 216 </xsl:otherwise> 217 </xsl:choose> 218 </xsl:template> 219 --> 87 220 </xsl:stylesheet> 88 221
Note:
See TracChangeset
for help on using the changeset viewer.