Changeset 36261


Ignore:
Timestamp:
2022-06-20T12:18:21+12:00 (2 weeks ago)
Author:
kjdon
Message:

small changes for snippets (solr). previously the snippet template was outputting <tr>s, but being called inside a <tr>. move the <tr> bit outside of the highlightSnippet template, and make the snippets output as a <ul>

File:
1 edited

Legend:

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

    r36084 r36261  
    8686            </xsl:if>
    8787
    88       <!-- The node contents -->
    89       <xsl:apply-templates select="."/>
    90 
    91         <xsl:call-template name="highlightSnippet">
     88            <!-- The node contents -->
     89            <xsl:apply-templates select="."/>
     90        <xsl:call-template name="documentNodePost"/>
     91      </tr>
     92          <!-- for solr, this adds another row with the snippet info -->
     93          <tr><td colspan="5">
     94      <xsl:call-template name="highlightSnippet">
    9295          <xsl:with-param name="nodeHASH">
    9396              <xsl:value-of select="@nodeID"/>
     
    9699          <!--<xsl:choose> <xsl:when test="@collection"><xsl:value-of select="@collection"/></xsl:with-param>-->
    97100        </xsl:call-template>
    98         <xsl:call-template name="documentNodePost"/>
    99       </tr>
     101          </td></tr>
    100102    </xsl:for-each>
    101103    <br/>
     
    183185    <xsl:param name="nodeHASH"/>
    184186    <xsl:param name="collection"/>
    185     <xsl:for-each select="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]">
    186       <xsl:if test="not($collection) or $collection = @collection">
    187         <tr>
    188           <td>
    189           </td>
    190           <td>
    191             <div class="HighlightSnippet">
     187    <xsl:if test="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]">
     188      <ul style="list-style-type:none">
     189        <xsl:for-each select="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]">
     190          <xsl:if test="not($collection) or $collection = @collection">
     191            <li class="HighlightSnippet">
    192192              <xsl:value-of select="." disable-output-escaping="yes"/>
    193         </div>
    194           </td>
    195         </tr>
    196       </xsl:if>
    197     </xsl:for-each>
     193            </li>
     194          </xsl:if>
     195        </xsl:for-each>
     196      </ul>
     197    </xsl:if>
     198 
    198199  </xsl:template>
    199200 
Note: See TracChangeset for help on using the changeset viewer.