Changeset 37612 for main


Ignore:
Timestamp:
2023-04-06T15:12:16+12:00 (13 months ago)
Author:
kjdon
Message:

docNode templates now just call other named templates - makes it easier for using new tempaltes from collections without duplicating the code in the service description in siteConfig

File:
1 edited

Legend:

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

    r37553 r37612  
    3939        <xsl:for-each select="/page/pageResponse/favouriteList/documentNode">
    4040          <xsl:variable name="doc_id" select="concat(@collection, ':', @nodeID)"/>
    41           <xsl:variable name="plain"><xsl:apply-templates mode="plain-text" select="."/></xsl:variable>
     41          <xsl:variable name="plain"><xsl:apply-templates select="." mode="plain-text" /></xsl:variable>
    4242         
    4343          <xsl:text disable-output-escaping="yes">docList.push("</xsl:text><xsl:value-of select="$doc_id"/><xsl:text disable-output-escaping="yes">");</xsl:text>
     
    102102    </xsl:template>
    103103
    104     <!-- this template for displaying the favourites list -->
     104    <!-- this template for displaying the favourites list
     105        this will only be used if there ends up being no corresponding templates in siteConfig and collections. -->
    105106    <xsl:template match="documentNode">
    106      
     107          <xsl:call-template name="displayFavourite"/>
     108        </xsl:template>
     109       
     110        <xsl:template name="displayFavourite">
    107111      <gsf:if-metadata-exists><gsf:metadata name="srclinkFile"/><gsf:if><a><xsl:attribute name='href'><xsl:value-of select="$base-href"/><xsl:value-of select="$library_name"/>/sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select='@collection'/>/index/assoc/<gsf:metadata name="root_assocfilepath"/>/<gsf:metadata name="srclinkFile"/></xsl:attribute><gsf:choose-metadata><gsf:metadata name="thumbicon"/><gsf:metadata name="srcicon"/></gsf:choose-metadata></a></gsf:if></gsf:if-metadata-exists>
    108112      <xsl:text> </xsl:text><a><xsl:attribute name='href'><xsl:value-of select="$base-href"/><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select='@collection'/>/document/<xsl:value-of select='@nodeID'/><xsl:if test="$opt-doc-link-args">?<xsl:value-of select="$opt-doc-link-args"/></xsl:if></xsl:attribute><xsl:call-template name='choose-title'/></a> (<a href='{$library_name}/collection/{@collection}/page/about'><xsl:value-of select="@collection"/> </a>)
    109113    </xsl:template>
    110114   
     115    <!-- this template for displaying the favourites list in plain text for email and copy buffer
     116        this will only be used if there ends up being no corresponding templates in siteConfig and collections. -->
    111117    <xsl:template match="documentNode" mode="plain-text">
    112       <xsl:call-template name='choose-title'/>
    113       <xsl:text> (</xsl:text><xsl:value-of select="@collection"/><xsl:text>)</xsl:text>
     118          <xsl:call-template name="displayPlainText"/>
     119        </xsl:template>
     120
     121        <xsl:template name="displayPlainText">
     122          <xsl:call-template name='choose-title'/><xsl:text> (</xsl:text><xsl:value-of select="@collection"/><xsl:text>)</xsl:text>
    114123      <gsf:if-metadata-exists><gsf:metadata name="srclinkFile"/><gsf:if>
    115124      <xsl:text>\n\t</xsl:text>https://<xsl:value-of select="$base-href"/><xsl:value-of select="$library_name"/>/sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select='@collection'/>/index/assoc/<gsf:metadata name="root_assocfilepath"/>/<gsf:metadata name="srclinkFile"/></gsf:if></gsf:if-metadata-exists>
     
    117126    </xsl:template>
    118127
     128       
    119129    <xsl:template name="customJavascript">
    120130    </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.