Ignore:
Timestamp:
2017-03-16T14:42:01+13:00 (7 years ago)
Author:
kjdon
Message:

a couple of small but significant changes. when getting the table of contents and using excerptid, just use ec=1 (expand contents) rather than ed=1 (expand document). the prevents us having to retrieve all the text sections of the document just to get the table of contents out. add the expand document and collapse document links into the toc when ed=1 or ec=1. they weren't there before. So then we don't need to add them to toc after retrieving toc, as they are already present. Lastly, changed the expand and collapse doc links to be standard html links - a full reload of the document - rather than javascript. HOpefully this will mean that google can follow these links and index the pages. need to test this out as the toc is not part of the original page source.

File:
1 edited

Legend:

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

    r31238 r31520  
    110110                                </tbody></table>-->
    111111                            </xsl:when>
    112                             <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1')">
     112                            <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageRequest/paramList/param[@name = 'ec']/@value = '1')">
    113113                                <div id="tableOfContents">
    114114                                    <div id="tocLoadingImage" style="text-align:center;">
     
    126126                            </xsl:when>
    127127                            <xsl:otherwise>
     128                              <!-- *TODO *********-->
     129                              <xsl:variable name="doc_url"><xsl:value-of select='$library_name'/>/collection/<xsl:value-of select='/page/pageResponse/collection/@name'/>/document/<xsl:value-of select='/page/pageResponse/document/documentNode/@nodeID'/>?<!--<xsl:value-of select='/page/pageRequest/@fullURL'/>--></xsl:variable>
    128130                                <div id="tableOfContents">
    129131                                    <xsl:attribute name="class">
    130132                                        <xsl:choose>
    131                                             <xsl:when test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">visible</xsl:when>
     133                                            <xsl:when test="count(//documentNode) > 1">visible</xsl:when>
    132134                                            <xsl:otherwise>hidden</xsl:otherwise>
    133135                                        </xsl:choose>
    134136                                    </xsl:attribute>
     137                                    <table style="width:100%; text-align:center;"><tr><td><a href="{$doc_url}ed=1"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc')"/></a></td><td><a href="{$doc_url}ed=0\"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.collapse_doc')"/></a></td></tr></table>
    135138                                    <xsl:for-each select="documentNode">
    136139                                        <xsl:call-template name="documentNodeTOC"/>
Note: See TracChangeset for help on using the changeset viewer.