User Tools

Site Tools


en:user:gs3_list_of_format_options

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
en:user:gs3_list_of_format_options [2019/10/21 21:15] kjdonen:user:gs3_list_of_format_options [2026/04/29 00:42] (current) – [Options] kjdon
Line 1: Line 1:
 +
 +
 +
 ====== List of Greenstone3 Format Items ====== ====== List of Greenstone3 Format Items ======
  
Line 23: Line 26:
 ^Option name^Values^Format^Description^ ^Option name^Values^Format^Description^
 | |||| | ||||
-|hideStatus|true|search|If set to true, will hide the line 'displaying 0 to 20 of 40 documents' in the search results|+|allowGLIEditing|false|top level|If set to true (or absent)allows editing of this collection using Webswing GLI|
 |[[rss|RSS]]|true| |If set to true, will add a RSS Feed link to the collection| |[[rss|RSS]]|true| |If set to true, will add a RSS Feed link to the collection|
 +|hideStatus|true|search|If set to true, will hide the line 'displaying 0 to 20 of 40 documents' in the search results|
 |turnstyleClassifiers|false|browse|By default, bookshelves display a plus icon to open up that section of the classifier in place. <gsf:link> will also use ajax to open the current section. If turnstyleClassifiers is set to false, then the plus icon is not displayed and <gsf:link> will open a new page for just that section of the classifier.| |turnstyleClassifiers|false|browse|By default, bookshelves display a plus icon to open up that section of the classifier in place. <gsf:link> will also use ajax to open the current section. If turnstyleClassifiers is set to false, then the plus icon is not displayed and <gsf:link> will open a new page for just that section of the classifier.|
 |mapEnabled|true|display,search,browse| | |mapEnabled|true|display,search,browse| |
Line 33: Line 37:
 |backToTopLinks| |display|?| |backToTopLinks| |display|?|
 |sideBar|false |display|If false will not display any of the right side bar features, including cover image, search term highlighting checkbox, table of contents etc | |sideBar|false |display|If false will not display any of the right side bar features, including cover image, search term highlighting checkbox, table of contents etc |
 +|documentType|simple, paged, hierarchy, pagedhierarchy|display|The default document type to use if it's not specified in the document result|
 |disableZoom|true|display| | |disableZoom|true|display| |
 |disableSearchTermHighlighting|true|display|If set to true, will not highlight search terms in the text, and will not display the on/off button for highlighting| |disableSearchTermHighlighting|true|display|If set to true, will not highlight search terms in the text, and will not display the on/off button for highlighting|
Line 56: Line 61:
 To see what parameters you have that you can change, you can look at the page source for a query page and see what names and values the form elements have. To see what parameters you have that you can change, you can look at the page source for a query page and see what names and values the form elements have.
  
-These can be added inside the <search> and <display> format statements using GLI or directly editing  the collectionConfig.xml file).+These can be added inside the <format> elements for <search> and <display> using GLI or directly editing the collectionConfig.xml file).
  
 ==== Templates ==== ==== Templates ====
Line 63: Line 68:
 ''<gsf:template match="documentNode">template definition </gsf:template>''  matches a documentNode element. ''<gsf:template match="documentNode">template definition </gsf:template>''  matches a documentNode element.
  
 +==== Other ====
 +
 +The ''display'' ''format'' element can also contain ''<gsf:headMetaTags>'' element. This looks something like the following, and is used to add metadata into the HTML header of the document page.
 +<code>
 +<gsf:headMetaTags>
 +   <gsf:metadata name="dc.Title"/>
 +   <gsf:metadata name="dc.Subject"/>
 +   <gsf:metadata name="dls.Organization"/>
 +   <gsf:metadata name="dc.Author"/>
 +</gsf:headMetaTags>
 +</code>
 +This will output META tags for any of these metadata elements present for the document, like:
 +<code>
 +<META CONTENT="Butterfly Farming in Papua New Guinea" NAME="dc.Title" />
 +</code>
 +  
 +To change the NAME attribute, use the ''tag'' attribute in the gsf:metadata element. For example:
 +
 +<code>
 +<gsf:headMetaTags>
 +   <gsf:metadata name="dc.Title" tag="Title"/>
 +</gsf:headMetaTags>
 +</code>
 +Will output
 +<code>
 +<META CONTENT="..dc.Title value.." NAME="Title"/>
 +</code>
 +
 +<nowiki>[tag attribute available from Greenstone 3.12 and later]</nowiki>
 ===== What can go inside a template? ===== ===== What can go inside a template? =====
 ==== Links ==== ==== Links ====
Line 150: Line 184:
 |format|formatDate|turns '20040201' into '01 February 2004' (in a language dependent manner)| |format|formatDate|turns '20040201' into '01 February 2004' (in a language dependent manner)|
 |:::|formatLanguage|turns language code into language name, e.g. 'en' into 'English'.| |:::|formatLanguage|turns language code into language name, e.g. 'en' into 'English'.|
 +
 +=== Table of Metadata ===
 +
 +Sometimes you want a table of metadata values. You can use <gsf:metadata-table> for this. The format is like the following:
 +A list of metadata elements, each containing the label that should be used for the metadata.
 +<code>
 +<gsf:metadata-table>
 +<gsf:metadata name="Title"><gsf:interfaceText name="Title.display"/></gsf:metadata>
 +<gsf:metadata format="formatNewLines" name="Description"><gsf:interfaceText name="Description.display"/></gsf:metadata>
 +<gsf:metadata name="Date" show-if-empty="true"><displayItem dictionary="interface_custom" key="Date"/></gsf:metadata>
 +<gsf:metadata name="Subject">Subject</gsf:metadata>
 +</gsf:metadata-table>
 +
 +</code>
 +
  
 === Hidden metadata === === Hidden metadata ===
Line 157: Line 206:
 |hidden|true|If true, then the metadata will be retrieved from the server, but not displayed at that point. | |hidden|true|If true, then the metadata will be retrieved from the server, but not displayed at that point. |
  
 +
 +==== Collection/Interface Text Strings ====
 +
 +These will be displayed in the current interface language (if available), otherwise in the default language.
 +
 +^Format Element^Greenstone2 equivalent^Description^
 +|     |||
 +|''<gsf:displayText name='xxx'/>'' |Will display the xxx displayItem from the collection's //collectionConfig.xml// file. If that is not found, will try to look for xxx from the interface's property file.|
 +|''<gsf:displayItem name='xxx'/>'' |Display the xxx displayItem from the collection's //collectionConfig.xml// file.|
 +|''<gsf:interfaceText name='xxx'/>'' | Display the xxx interface text string (from //interface_default.properties// in web/WEB-INF/classes)|
 +|''<gsf:interfaceText name='xxx' propertyFile='file_name'/>'' | | Display the xxx string from the //<file_name>.properties// file (in web/WEB-INF/classes) (Greenstone version 3.10 and later)|
 +|''<gsf:collectionText name='xxx'/>'' |Display the xxx from the current collection's //interface_custom.properties// file (found in resources folder inside the collection) |
 +|''<gsf:collectionText name='xxx' propertyFile='file_name'/>'' |Display the xxx from the current collection's //<file_name>.properties// file (found in resources folder inside the collection) |
  
 ==== Miscellaneous Things ==== ==== Miscellaneous Things ====
Line 162: Line 224:
 |     ||| |     |||
 |''<gsf:cgi-param name='query'/>''| _cgiargq_|The value of a cgi param (in this case will get s1.query from the cgi arguments)| |''<gsf:cgi-param name='query'/>''| _cgiargq_|The value of a cgi param (in this case will get s1.query from the cgi arguments)|
-|''<gsf:displayText name='xxx'/>'' |Will display the xxx displayItem from the collection's collectionConfig.xml file. If that is not found, will try to look for xxx from the interface's property file.| 
-|''<gsf:displayItem name='xxx'/>'' |Display the xxx displayItem from the collection's collectionConfig.xml file.| 
-|''<gsf:interfaceText name='xxx'/>'' | Display the xxx interface text string (from interface_default.properties in web/WEB-INF/classes)| 
-|''<gsf:collectionText name='xxx'/>'' |Display the xxx from the current collection's colname.properties file (found in resources folder inside the collection) | 
-|''<gsf:html>&lt;li&gt;</gsf:html>''| <li>|Sometimes you want to output some HTML that is not valid XML in the config file. For example, adding <li> and </li> as prefix and suffix to a list of metadata values. In the final HTML it will be valid XML, but in the template it won't be. So use escaped < and > and enclose the text in <gsf:html> tags.| 
 |''<gsf:variable name='xxx'>value</gsf:variable>'' |Will output an <xsl:variable> into the transform result. Also, sets gs.variables.xxx = value, which is available for use in javascript code.| |''<gsf:variable name='xxx'>value</gsf:variable>'' |Will output an <xsl:variable> into the transform result. Also, sets gs.variables.xxx = value, which is available for use in javascript code.|
 +|''<gsf:html>&lt;li&gt;</gsf:html>''| <li>|Sometimes you want to output some HTML that is not valid XML in the config file. For example, adding <li> and </li> as prefix and suffix to a list of metadata values. In the final HTML it will be valid XML, but in the template it won't be. So use escaped < and > and enclose the text in <gsf:html> tags.|
 +
  
 ==== Conditional ==== ==== Conditional ====
Line 241: Line 300:
 |lang|language code|Defines the language whose sorting conventions are to be used| |lang|language code|Defines the language whose sorting conventions are to be used|
 |data-type|text/number/data-type name|Defines whether values are sorted alphabetically, numerically, or using a user-defined data type| |data-type|text/number/data-type name|Defines whether values are sorted alphabetically, numerically, or using a user-defined data type|
 +
 +==== Utility Functions ====
 +
 +There are many utility functions defined in src/java/org/greenstone/gsdl3/util/XSLTUtil.java. Some of these are used behind the scenes, as part of gsf elements. For example, ....
 +
 +They can be called explicitly using
 +<code>
 +<xsl:value of select="util:fname(args)"/>
 +</code>
 +args is a comma separated list of args. They can be XSLT variables, numbers, strings, XSLT elements/attributes.
 +
 +For example:
 +<code>
 +   <xsl:variable name="raw_date"><gslib:collectionMeta name="buildDate"/></xsl:variable>
 +   The collection was last built on <xsl:value-of select="util:formatTimeStamp($raw_date, 0, 0, /page/@lang)"/>
 +</code>
 +
 +This code is getting the buildDate timestamp from collection metadata. Then it is formatting it using the formatTimeStamp function.
 +This function takes 4 arguments:
 +  * the timestamp - here we use the raw_date variable we have just made
 +  * an integer for timestamp type - 0 is seconds, 1 is milliseconds
 +  * an integer for output format tupe - 0 is date, 1 is time, 2 is date and time, 3 is days ago
 +  * the language code for which language you want the output in - here we use the attribute from the page element.
 +
 +We could change this output to days ago:
 +The collection was last built <xsl:value-of select="util:formatTimeStamp($raw_date, 0, 3, /page/@lang)"/> days ago.
  
 ==== Additional Notes ==== ==== Additional Notes ====
 +
  
 Some of these options (<gsf:html>; using <gsf:metadata> inside the parameters for a search link) are not available in the 3.07 release. If you are using 3.07, you can download an updated config_format.xsl file. Rename your current greenstone3/web/interfaces/default/transform/config_format.xsl (so that you can put it back if something goes wrong), and copy this one into its place. Some of these options (<gsf:html>; using <gsf:metadata> inside the parameters for a search link) are not available in the 3.07 release. If you are using 3.07, you can download an updated config_format.xsl file. Rename your current greenstone3/web/interfaces/default/transform/config_format.xsl (so that you can put it back if something goes wrong), and copy this one into its place.
en/user/gs3_list_of_format_options.1571692517.txt.gz · Last modified: 2019/10/21 21:15 (external edit)