Changeset 26345 for main/trunk


Ignore:
Timestamp:
2012-10-18T14:31:13+13:00 (12 years ago)
Author:
kjdon
Message:

gsf:links can have a rollover text. specify the text in title att, or a key for colleciton dictionary in titlekey att. added this to almost all types of links - not for those where the a tag is defined in another place

File:
1 edited

Legend:

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

    r26336 r26345  
    7070    <xsl:template match="gsf:link">
    7171    <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
     72    <xsl:variable name="opt-title">                 
     73      <xsl:choose>
     74    <xsl:when test="@title"><xslt:attribute name="title"><xsl:value-of select="@title"/></xslt:attribute></xsl:when>
     75    <xsl:when test="@titlekey"><xslt:attribute name="title"><xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@titlekey}')"/></xslt:attribute></xsl:when>
     76      </xsl:choose>
     77    </xsl:variable>
    7278        <xsl:choose>
    7379            <xsl:when test="@type='query'">
     
    8793                        </xsl:choose>
    8894                    </xslt:attribute>
     95                                        <xsl:copy-of select="$opt-title"/>
    8996                    <xsl:apply-templates/>
    9097                </a>
     
    106113                        </xsl:choose>
    107114                    </xslt:attribute>
     115                                        <xsl:copy-of select="$opt-title"/>
    108116                    <xsl:apply-templates/>
    109117                </a>
     
    114122                   disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='assocfilepath']" />/<xslt:value-of
    115123                   disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='srclinkFile']" /></xslt:attribute>
     124                                  <xsl:copy-of select="$opt-title"/>
    116125                  <xsl:apply-templates/>
    117126                </a>
    118127            </xsl:when>
    119128            <xsl:when test="@type='web'">
    120               <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, 'weblink')]"/>
     129    <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, 'weblink')]"/>
    121130              <xsl:apply-templates/>
    122131              <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, '/weblink')]"/>
     
    131140                        <xsl:value-of select="@page"/>
    132141                    </xslt:attribute>
    133                     <xsl:choose>
    134                         <xsl:when test="@title"><xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute></xsl:when>
    135                         <xsl:when test="@titlekey"><xslt:attribute name="title"><xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@titlekey}')"/></xslt:attribute></xsl:when>
    136                     </xsl:choose>
    137                     <xsl:apply-templates/>
     142                                    <xsl:copy-of select="$opt-title"/>
     143                <xsl:apply-templates/>
    138144                </a>   
    139145            </xsl:when>
     
    146152                </xslt:variable>
    147153                <a>
     154                              <xsl:copy-of select="$opt-title"/>
    148155                    <xslt:attribute name="href">
    149156                        <xslt:value-of select='$library_name'/>
     
    285292    <!-- With gsf:collectionText, a user can request a string from the collection's dictionary in the current lang -->
    286293    <xsl:template match="gsf:collectionText" name="gsf:collectionText">
    287     <!--<xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>-->
     294    <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
    288295        <xslt:value-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')"/>
    289296    </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.