Changeset 36041


Ignore:
Timestamp:
2022-02-03T10:25:35+13:00 (2 years ago)
Author:
cstephen
Message:

Imlpement shared document templates so that the TOC can be used outside of a document

Location:
main/trunk/greenstone3/web/interfaces/default/transform
Files:
1 added
2 edited

Legend:

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

    r36027 r36041  
    88    extension-element-prefixes="java util"
    99    exclude-result-prefixes="java util gsf">
     10
     11    <xsl:include href="../pages/document-shared.xsl" />
    1012
    1113    <xsl:template name="rightSidebarTOC">
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r36027 r36041  
    1515    <!-- templates for adding user comments -->
    1616    <xsl:import href="layouts/usercomments.xsl"/>
     17
     18    <!-- We technically need this include. However, it is imported with toc.xsl -->
     19    <!-- <xsl:include href="document-shared.xsl" /> -->
    1720   
    1821    <xsl:variable name="bookswitch">
     
    8487            </div>
    8588        </div>
    86     </xsl:template>
    87 
    88     <xsl:template name="sectionHeading">
    89         <xsl:call-template name="sectionTitle"/>
    9089    </xsl:template>
    9190   
     
    627626    </xsl:template>
    628627   
    629    
    630     <!-- The default template for displaying section titles -->
    631     <xsl:template name="sectionTitle">
    632       <!--<xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
    633 -->   <gsf:metadata name="Title" highlight="true"/><!-- allows search term highlighting in section titles-->
    634     </xsl:template>
    635    
    636628    <xsl:template name="wrappedSectionImage">
    637629        <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
     
    737729        <xsl:text> </xsl:text>
    738730    </xsl:template>
    739 
    740     <!-- display the text content of a node (content node or metadata node), marking up the annotations -->
    741     <xsl:template name="displayMarkedUpTextAndAnnotations">
    742       <xsl:variable name="annotation_class">
    743         <xsl:choose>
    744           <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off' or /page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true'">noTermHighlight</xsl:when>
    745           <xsl:otherwise>termHighlight</xsl:otherwise>
    746         </xsl:choose>
    747       </xsl:variable>
    748       <xsl:for-each select="node()">
    749         <xsl:choose>
    750           <xsl:when test="not(name())">
    751         <xsl:value-of select="." disable-output-escaping="yes"/>
    752           </xsl:when>
    753           <xsl:when test="name() = 'annotation'">
    754         <span class="{$annotation_class}"><xsl:value-of select="."/></span>
    755           </xsl:when>
    756           <xsl:otherwise>
    757         <xsl:apply-templates/>
    758           </xsl:otherwise>
    759         </xsl:choose>
    760       </xsl:for-each>
    761     </xsl:template>
    762 
    763731   
    764732    <!-- The default template for displaying the document node text in
Note: See TracChangeset for help on using the changeset viewer.