Changeset 30727


Ignore:
Timestamp:
08/22/16 11:27:35 (4 years ago)
Author:
kjdon
Message:

we should use root_assocfilepath in case we are at a section level

File:
1 edited

Legend:

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

    r30699 r30727  
    140140            </xsl:choose>
    141141        </xslt:variable>
     142        <xslt:variable name="thisAssocfilepath">                   
     143          <xslt:choose>
     144            <xslt:when test="/page/pageResponse/document">
     145              <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" />
     146            </xslt:when>
     147            <xslt:otherwise>
     148              <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='root_assocfilepath']" />
     149            </xslt:otherwise>
     150          </xslt:choose>                       
     151        </xslt:variable>
    142152          <xslt:if test="./metadataList/metadata[@name = $metaName]">
    143153            <img>
    144154                <xslt:attribute name='src'>
    145155                    <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name = 'httpPath']"/>
    146                     <xsl:text>/index/assoc/</xsl:text>
    147                     <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>
    148                     <xsl:text>/</xsl:text>
     156                    <xsl:text>/index/assoc/</xsl:text><xslt:value-of disable-output-escaping="yes" select="$thisAssocfilepath" /><xsl:text>/</xsl:text>
    149157                    <xslt:choose>
    150158                      <xslt:when test="$metaName = 'hascover'">cover.jpg</xslt:when>
     
    248256                        </xslt:when>
    249257                        <xslt:otherwise>
    250                             <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='assocfilepath']" />
     258                            <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='root_assocfilepath']" />
    251259                        </xslt:otherwise>
    252260                    </xslt:choose>                     
Note: See TracChangeset for help on using the changeset viewer.