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 revision
Previous revision
Next revisionBoth sides next revision
en:user:gs3_sample_interface_modifications [2016/05/12 02:08] kjdonen:user:gs3_sample_interface_modifications [2019/09/23 00:17] kjdon
Line 3: Line 3:
 This page provides examples of interface modifications. Many of these changes can be made at either the collection, interface or site level. This page provides examples of interface modifications. Many of these changes can be made at either the collection, interface or site level.
  
-===== General =====+See the [[en:user:interfaces|interfaces page]] for more general information about customising the interface. 
 + 
 +==== Changing the collection description ==== 
 + 
 +The collection's description - shown on the about page - generally comes from the 'description' displayItem in the collection's collectionConfig.xml file. This can only hold text and html. Sometimes you might want to do more in the description. 
 + 
 +The place where the description gets printed out is in the about page XSL: web/interfaces/default/transform/pages/about.xsl. 
 + 
 +There is a template called coll-description: 
 +<code> 
 +<xsl:template name="coll-description"> 
 +   <gslib:collectionDescriptionTextAndServicesLinks/> 
 +</xsl:template> 
 +<code> 
 + 
 +<gslib> elements are shortcuts to predefined templates, and can be found in web/interfaces/default/transform/gslib.xsl. 
 + 
 +Lets leave the collection description displayed as is, but output "This collection contains X documents, and was last built on Y". 
 + 
 +We can redefine the template as: 
 +<code> 
 +<xsl:template name="coll-description"> 
 +   <gslib:collectionDescriptionTextAndServicesLinks/> 
 +   <xsl:variable name="raw_date"><gslib:collectionMeta name="buildDate"/></xsl:variable> 
 +   The collection contains <gslib:collectionMeta name="numDocs"/> documents, and was last built on <xsl:value-of select="util:formatTimeStamp($raw_date, 0, 0, /page/@lang)"/>
 +</xsl:template> 
 +<code> 
 + 
 +<gslib:collectionMeta> can retrieve metadata elements from the collection (as opposed to from documents). 
 +The buildDate metadata element is a timestamp, so is not user friendly. We can use one of our utility functions to format it.
  
 ==== 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