Changeset 25824


Ignore:
Timestamp:
2012-06-26T15:42:01+12:00 (12 years ago)
Author:
kjdon
Message:

trying to make the display nicer for simple doc types. Also adding in some extra templates so its easier for users to modify the actual content of the doc page

File:
1 edited

Legend:

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

    r25720 r25824  
    177177                </xsl:attribute>
    178178                <!-- Get the section content from the document template -->
    179                 <xsl:call-template name="documentNodeContent"/>
     179                <xsl:call-template name="documentNodeText"/>
    180180            </div>
    181181            <xsl:if test="documentNode">
     
    256256                </script>
    257257            </xsl:when>
    258             <xsl:otherwise>
     258      <xsl:when test="@docType='simple'">
     259            <xsl:call-template name="documentHeading"/><br/>
     260            <xsl:call-template name="documentContent"/>
     261</xsl:when>         
     262<xsl:otherwise> <!-- display the standard greenstone document -->
     263<xsl:call-template name="documentContent"/>
     264</xsl:otherwise>
     265</xsl:choose>
     266</xsl:template>
     267    <xsl:template name="documentContent">
     268      <xsl:choose>
     269        <xsl:when test="@docType='simple'">
     270          <xsl:call-template name="documentNodeText"/>
     271        </xsl:when>
     272        <xsl:otherwise>
     273          <xsl:call-template name="wrappedDocument"/>
     274        </xsl:otherwise>
     275      </xsl:choose>
     276    </xsl:template>
     277
     278    <xsl:template name="wrappedDocument">
    259279                <xsl:choose>
    260280                    <xsl:when test="/page/pageRequest/paramList/param[@name = 'alb']/@value = '1' or (string-length(/page/pageRequest/paramList/param[@name = 'd']/@value) > 0 and (/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or not(util:contains(/page/pageResponse/document/@selectedNode, '.'))))">
     
    265285                                    <xsl:call-template name="wrapDocumentNodes"/>
    266286                                </xsl:for-each>
     287
    267288                            </div>
    268289                        </div>
     
    298319                        </script>
    299320                    </xsl:otherwise>
    300                 </xsl:choose>
    301             </xsl:otherwise>
    302321        </xsl:choose>
    303322       
     
    437456        </xsl:choose>
    438457    </xsl:template>
    439    
    440     <!-- The default template for displaying the document content -->
    441     <xsl:template name="documentNodeContent">
     458    <xsl:template name="documentHeading">
     459      <b><gsf:metadata name="Title"/></b><br/>
     460    </xsl:template>
     461    <!-- The default template for displaying the document node text -->
     462  <!-- equivalent to gsf:text -->
     463    <xsl:template name="documentNodeText">
    442464        <!-- Hides the "This document has no text." message -->
    443465        <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
     466                        <xsl:if test="not($noText = '1')">
    444467
    445468        <!-- Section text -->
     
    448471                <xsl:choose>
    449472                    <xsl:when test="not(name())">
    450                         <xsl:if test="not($noText = '1')">
    451473                            <xsl:value-of select="." disable-output-escaping="yes"/>
    452                         </xsl:if>
     474                   
    453475                    </xsl:when>
    454476                    <xsl:when test="name() = 'annotation'">
    455477                        <xsl:call-template name="displayAnnotation"/>
    456                     </xsl:when>
    457                     <xsl:when test="name() = 'nodeContent'">
    458                         <xsl:call-template name="documentNodeContent"/>
    459478                    </xsl:when>
    460479                    <xsl:otherwise>
     
    463482                </xsl:choose>
    464483            </xsl:for-each>
    465         </xsl:for-each><xsl:text> </xsl:text>
    466     </xsl:template>
    467    
     484        </xsl:for-each> </xsl:if><xsl:text> </xsl:text>
     485    </xsl:template>
     486
    468487    <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
    469488    <xsl:template name="documentNodeFlashXML">
Note: See TracChangeset for help on using the changeset viewer.