Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:user:gs3_format_statements [2016/05/12 13:59]
kjdon
en:user:gs3_format_statements [2019/07/23 11:04] (current)
kjdon [Select]
Line 8: Line 8:
 Format statements must be written in well-formed XML. XML syntax is very similar to HTML. [[http://​www.w3schools.com/​xml/​xml_syntax.asp|W3Schools]] provides a list of the basic XML syntax rules. The Format Features section automatically checks your XML and errors will appear in the **XML Validation** text box.  Format statements must be written in well-formed XML. XML syntax is very similar to HTML. [[http://​www.w3schools.com/​xml/​xml_syntax.asp|W3Schools]] provides a list of the basic XML syntax rules. The Format Features section automatically checks your XML and errors will appear in the **XML Validation** text box. 
  
-This page provides an overview of format statements. There is also a [[gs3_list_of_format_options|list of format statements]]. +This page provides an overview of format statements. There is also a [[gs3_list_of_format_options|list of formatting elements]] that can go in format statements
  
 ===== Format Features ===== ===== Format Features =====
Line 126: Line 126:
   * ''<​gsf:​metadata name="​screenicon"/>''​ will display a larger version (width of 500px) of the image than the thumbnail.   * ''<​gsf:​metadata name="​screenicon"/>''​ will display a larger version (width of 500px) of the image than the thumbnail.
  
 +==== Adding new srcicons ====
  
-===== Metadata =====+If you have used source documents, such as mp4, where greenstone doesn'​t have an icon for it, you may see _iconmp4_ instead of an icon in the display. If this happens, you need to add an appropriate icon into web/​interfaces/​default/​images,​ and define a mapping for the macro in web/​sites/​localsite/​siteConfig.xml. For example, if we copy the mp3 example and add an icon for mp4, we would add imp4.gif into images folder, and add the following line into siteConfig.xml,​ into the <​replaceList>​ element: 
 +<​code>​ 
 +    <replace macro="​_iconmp4_"​ scope="​metadata"​ text="&​lt;​img src='​interfaces/​default/​images/​imp4.gif'​ border='​0'/&​gt;"​ resolve="​false"/>​ 
 +</​code>​ 
 + 
 +===== Document ​Metadata =====
  
 Any metadata that has been extracted from or added to documents can be referenced in format statements using the ''​gsf:​metadata''​ tag. Metadata is referred to by its element name. For example, if you have provided ''​dc.Title''​ metadata for your documents, ''<​gsf:​metadata name="​dc.Title"/>''​ will display these values. Any metadata that has been extracted from or added to documents can be referenced in format statements using the ''​gsf:​metadata''​ tag. Metadata is referred to by its element name. For example, if you have provided ''​dc.Title''​ metadata for your documents, ''<​gsf:​metadata name="​dc.Title"/>''​ will display these values.
  
-If you want to display the file name for documents, ''<​gsf:​metadata name="​Source"/>'' ​can be used to display them; to display the number of pages/​sections in a document, use ''<​gsf:​metadata name='​numDocs'/>''​ to display the number of pages/​sections in a document. //(Note that the metadata name does not include the ''​ex.''​ namespace. Extracted metadata is referred to without the namespace in format statements. Metadata in all other namespaces--e.g. ''​dc.'',​ ''​gs.'',​ ''​dls.'',​ etc.--__does__ require the namespace, as shown in the ''​dc.Title''​ example above.)//+If you want to display the file name for documents, ​use ''<​gsf:​metadata name="​Source"/>''​. //(Note that the metadata name does not include the ''​ex.''​ namespace. Extracted metadata is referred to without the namespace in format statements. Metadata in all other namespaces--e.g. ''​dc.'',​ ''​gs.'',​ ''​dls.'',​ etc.--__does__ require the namespace, as shown in the ''​dc.Title''​ example above.)//
  
  
Line 158: Line 164:
   * ''<​gsf:​metadata name="​Title"​ select="​ancestors"/>''​ is the titles for sections 2.5, 2, and the document   * ''<​gsf:​metadata name="​Title"​ select="​ancestors"/>''​ is the titles for sections 2.5, 2, and the document
   * ''<​gsf:​metadata name="​Title"​ select="​root"/>''​ is the document title   * ''<​gsf:​metadata name="​Title"​ select="​root"/>''​ is the document title
-  * ''<​gsf:​metadata name="​Title"​ select="​siblings"/>''​ is the titles for sections 2.5.1, 2.5.2, 2.5.4, etc.+  * ''<​gsf:​metadata name="​Title"​ select="​siblings"/>''​ is the titles for sections 2.5.1, 2.5.2, 2.5.3, 2.5.4, etc.
   * ''<​gsf:​metadata name="​Title"​ select="​children"/>''​ displays the titles for sections 2.5.3.1, 2.5.3.2, etc.   * ''<​gsf:​metadata name="​Title"​ select="​children"/>''​ displays the titles for sections 2.5.3.1, 2.5.3.2, etc.
-  * ''<​gsf:​metadata name="​Title"​ select="​descendents"/>''​ displays the titles for sections 2.5.3.1, 2.5.3.1.1, 2.5.3.1.2, 2.5.3.2, 2.5.3.2.1, etc.+  * ''<​gsf:​metadata name="​Title"​ select="​descendants"/>''​ displays the titles for sections 2.5.3.1, 2.5.3.1.1, 2.5.3.1.2, 2.5.3.2, 2.5.3.2.1, etc. (from Greenstone version 3.10) 
 +  * ''<​gsf:​metadata name="​Title"​ select="​entire"/>''​ displays the titles for all sections of the document. (from Greenstone version 3.10) 
 + 
 +===== Classifier Metadata ===== 
 + 
 +Metadata for classifiers is referenced in the same way as for a document, like <​gsf:​metadata name="​Title"/>​. Classifier nodes only have a very limited set of metadata however. 
 +  * Title - the Title metadata gives the name of the classifier or bookshelf. One thing to note is that a bookshelf label is always stored as Title metadata, regardless of what metadata the classifier was built on. 
 +  * numleafdocs - this gives the number of documents underneath this part of the classifier.
  
 ===== Conditional ===== ===== Conditional =====
Line 253: Line 266:
  
 ===== Additional Resources ===== ===== Additional Resources =====
-  * The **[[en:​user:​list_of_format_options|list of format statements]]** can be a useful reference when writing up format statements in Greenstone.  +  * The **[[en:​user:​gs3_list_of_format_options|list of format statements]]** can be a useful reference when writing up format statements in Greenstone.  
-  * There are some **[[en:​user:​sample_format_statements|sample GS3 format statements]]** available.+  * There are some **[[en:​user:​gs3_sample_interface_modifications|sample GS3 format statements]]** available.
   * The templates in the GLI only effect very specific parts of the page. You may want to completely change large portions of how your Greenstone library looks. For more information on how to do this, check out the [[interfaces]] page.   * The templates in the GLI only effect very specific parts of the page. You may want to completely change large portions of how your Greenstone library looks. For more information on how to do this, check out the [[interfaces]] page.
   * [[http://​wiki.greenstone.org/​wiki/​images/​7/​71/​Skins_Doc.pdf|Greenstone 3 Interface Transformations Library: Basic Documentation]] //Maxime Roüast//   * [[http://​wiki.greenstone.org/​wiki/​images/​7/​71/​Skins_Doc.pdf|Greenstone 3 Interface Transformations Library: Basic Documentation]] //Maxime Roüast//