Ignore:
Timestamp:
2017-02-02T14:37:40+13:00 (7 years ago)
Author:
kjdon
Message:

breadcrumbs no longer display teh current group. description on the page uses group description if we are in a group. uses a few more templates from gslib. removes a couple of (old?) unused templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/home.xsl

    r31167 r31382  
    88    exclude-result-prefixes="java util">
    99
     10  <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
     11
     12 
    1013    <!-- use the 'main' layout -->
    1114    <xsl:include href="layouts/main.xsl"/>
    1215
    1316    <!-- set page title -->
    14     <xsl:template name="pageTitle"><gslib:siteName/></xsl:template>
     17    <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>
    1518
    1619    <!-- set page breadcrumbs -->
    1720    <xsl:template name="breadcrumbs">
    18         <xsl:if test="/page/pageRequest/paramList/param[@name='group']">
     21        <xsl:if test="$groupPath">
    1922            <gslib:siteLink/>
    2023            <xsl:for-each select="/page/pageResponse/pathList/group">
    2124                <xsl:sort data-type="number" select="@position"/>
    2225                <gslib:rightArrow/>
    23                 <a>
    24                 <xsl:attribute name="href">
    25                     <xsl:value-of select="$library_name"/>
    26                     <xsl:text>?a=p&amp;sa=home&amp;group=</xsl:text>
    27                     <xsl:value-of select="@path"></xsl:value-of>
    28                 </xsl:attribute>
    29                
    30                 <xsl:attribute name="title">
    31                     <xsl:value-of select="./title"></xsl:value-of>
    32                 </xsl:attribute>
    33                 <xsl:value-of select="./title"></xsl:value-of>
    34                 </a>
     26                <xsl:if test="position() != last()">
     27                  <!-- don't want the current group in the breadcrumbs -->
     28                  <a>
     29                    <xsl:attribute name="href"><gslib:groupHref path="{@path}"/></xsl:attribute>               
     30                    <xsl:attribute name="title"><gslib:groupName path="{@path}"/></xsl:attribute>
     31                    <gslib:groupName path="{@path}"/>
     32                  </a>
     33                </xsl:if>
    3534            </xsl:for-each>
    3635        </xsl:if>
     
    5756   
    5857            <div style="clear: both; padding-top: 4px; padding-bottom: 4px;"><hr/></div>
    59         <xsl:variable name="siteDesc"><gslib:siteDescription/></xsl:variable>
     58        <xsl:variable name="siteDesc"><xsl:choose><xsl:when test="$groupPath"><gslib:groupDescription path="{$groupPath}"/></xsl:when><xsl:otherwise><gslib:siteDescription/></xsl:otherwise></xsl:choose></xsl:variable>
    6059        <xsl:if test="$siteDesc != ''">
    6160          <xsl:value-of select="$siteDesc"/>
     
    7574    </xsl:template>
    7675
    77     <xsl:template name="groupLinks">
    78         <div id="groupLinks">
    79             <!-- <xsl:if test="count(groupList/group) = 0">
    80                 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
    81                 <br/>
    82             </xsl:if>
    83             -->
    84             <xsl:for-each select="groupList/group">
    85                 <gslib:groupLinkWithImage/>
    86             </xsl:for-each>
    87             <br class="clear"/>
    88         </div>
    89     </xsl:template>
    90    
    91     <xsl:template name="collectionLinks">
    92         <div id="collectionLinks">
    93             <xsl:if test="count(collectionList/collection) = 0">
    94                 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
    95                 <br/>
    96             </xsl:if>
    97             <xsl:for-each select="collectionList/collection">
    98                 <gslib:collectionLinkWithImage/>
    99             </xsl:for-each>
    100             <br class="clear"/>
    101         </div>
    102     </xsl:template>
    10376
    10477    <xsl:template match="/page/xsltparams">
Note: See TracChangeset for help on using the changeset viewer.