User Tools

Site Tools


en:user:gs3_sample_format_statements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
en:user:gs3_sample_format_statements [2016/10/09 21:01] – [Linking metadata to a search] kjdonen:user:gs3_sample_format_statements [2016/10/09 21:46] – [Linking metadata to a search] kjdon
Line 203: Line 203:
   * s1.index=CR   - the index to search in, in this case the CR dc.Creator index.   * s1.index=CR   - the index to search in, in this case the CR dc.Creator index.
  
 +==== adding in new javascript ====
 +
 +Displaying human readable filesize.
 +
 + <gsf:template match="documentNode">
 +   <td>
 +     <gsf:link type="document">
 +       <gsf:metadata name="dls.Keyword"/>
 +     </gsf:link>
 +   </td>
 +   <td>
 +
 +     <script type="text/javascript">
 +    <xsl:text disable-output-escaping="yes">
 + bytes =</xsl:text><gsf:metadata name="FileSize"/><xsl:text  disable-output-escaping="yes">;
 +    var filesize = bytes + " bytes";
 + if (bytes > 1048576) {
 + filesize = Math.round(bytes / 1048576.0) + " MB";
 + }
 + else if (bytes > 1024) {
 + filesize = Math.round(bytes/1024.0)+ " KB";
 + }
 + document.write(filesize);
 +
 + </xsl:text>
 +    </script>
 +  </td>
 + </gsf:template>
  
  
en/user/gs3_sample_format_statements.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1