User Tools

Site Tools


en:user:gs3_sample_interface_modifications

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_interface_modifications [2019/09/23 22:52] kjdonen:user:gs3_sample_interface_modifications [2019/09/23 22:59] kjdon
Line 35: Line 35:
  
 The buildDate metadata element is a timestamp, so is not user friendly. We can use one of our utility functions to format it. The buildDate metadata element is a timestamp, so is not user friendly. We can use one of our utility functions to format it.
 +
 +==== Total documents in library ====
 +
 +The above section shows how to add "this collection contains X number of documents" to a collection's about page. But what if we want to do that for the whole library?
 +
 +We can add up all the numDocs from each collection using 'sum', and count the number of collecitons using 'count':
 +
 +<code>
 +<xsl:template match="/page/pageResponse">
 +....
 +<xsl:variable name="totaldocs" select="sum(/page/pageResponse/collectionList/collection/metadataList/metadata[@name='numDocs'])" />
 +<xsl:variable name="totalcolls" select="count(/page/pageResponse/collectionList/collection)"/>
 +<p>This library contains a total of <xsl:value-of select="$totaldocs"/> documents over <xsl:value-of select="$totalcolls"/> collections.</p>
 +....
 +</xsl:template>
 +</code>
  
 ==== Footer modification (text on left, image on right) ==== ==== Footer modification (text on left, image on right) ====
en/user/gs3_sample_interface_modifications.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1