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:59] kjdonen:user:gs3_sample_interface_modifications [2019/09/24 00:33] – [Total documents in library] kjdon
Line 40: Line 40:
 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? 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':+We can add up all the numDocs from each collection using 'sum', and count the number of collections using 'count':
  
 <code> <code>
 <xsl:template match="/page/pageResponse"> <xsl:template match="/page/pageResponse">
 .... ....
-<xsl:variable name="totaldocs" select="sum(/page/pageResponse/collectionList/collection/metadataList/metadata[@name='numDocs'])" />+<xsl:variable name="totaldocs" select="sum(/page/pageResponse/collectionList/collection/metadataList 
 +/metadata[@name='numDocs'])" />
 <xsl:variable name="totalcolls" select="count(/page/pageResponse/collectionList/collection)"/> <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>+ 
 +<p>This library contains a total of <xsl:value-of select="$totaldocs"/> documents over <xsl:value-of  
 +select="$totalcolls"/> collections.</p>
 .... ....
 </xsl:template> </xsl:template>
en/user/gs3_sample_interface_modifications.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1