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
Next revisionBoth sides next revision
en:user:gs3_list_of_format_options [2018/11/04 21:25] – [List of Greenstone3 Format Items] kjdonen:user:gs3_list_of_format_options [2019/10/21 21:15] kjdon
Line 1: Line 1:
 ====== List of Greenstone3 Format Items ====== ====== List of Greenstone3 Format Items ======
  
-This page describes all the things that can go into the <format> element in the collectionConfig.xml file - or can be added in the Format->FormatFeatures pane in GLI. There are three main types of format itemsoptions, parameter defaults, and templates. Options give you switch to turn something on/off or change the look, parameter defaults let you change the default value of eg search parameters (stemming, casefolding etc) while templates let you describe what output you want.+This page describes all the things that can go into the <format> element in the collectionConfig.xml file - or can be added in the Format->FormatFeatures pane in GLI.  
 + 
 +Format items include options, parameter defaults, and templates. Templates can include standard XSL, but we have defined set of gsf elements which are shortcuts to XSL. 
 + 
 +''<gsf:xxx/>'' formatting items are converted to XSLT by the ''web/interfaces/default/transform/config_format.xsl'' file. 
 + 
 + 
    
 See also the description of [[en:user:gs3_format_statements|format statements]], and some [[en:user:gs3_sample_format_statements | sample format statements]] for miscellaneous tasks. See also the description of [[en:user:gs3_format_statements|format statements]], and some [[en:user:gs3_sample_format_statements | sample format statements]] for miscellaneous tasks.
  
-''<gsf:xxx/>'' formatting items are converted to XSLT by the ''web/interfaces/default/transform/config_format.xsl'' file. 
  
-===== Options =====+===== Top Level Elements ===== 
 + 
 +There are three main types of format items: options, parameter defaults, and templates. Options give you a switch to turn something on/off or change the look, parameter defaults let you change the default value of eg search parameters (stemming, casefolding etc) while templates let you describe what output you want. 
 + 
 +==== Options ====
  
-There are a few options available. They are specified by adding <gsf:option name="xxx" value="yyy"/> to the appropriate format element in GLI, or in the collectionConfig.xml file.+There are a few options available. They are specified by adding **<gsf:option name="xxx" value="yyy"/>** to the appropriate format element in GLI, or in the collectionConfig.xml file.
  
 ^Option name^Values^Format^Description^ ^Option name^Values^Format^Description^
Line 29: Line 39:
 |viewSelection|false|display|If false, will not show the text/image/default view selector for paged image documents. | |viewSelection|false|display|If false, will not show the text/image/default view selector for paged image documents. |
 |slideShow|false|display|If false, will not display the slideshow option for paged image documents | |slideShow|false|display|If false, will not display the slideshow option for paged image documents |
-|[[user_comments|AllowUserComments]]|true|display|If set to true, will allow users to add comments to public collections. Users need not have editing permissions for a collection they wish to add comments to. They just need to have an account on that Greenstone Digital Library.| +|[[user_comments|allowUserComments]]|true|display|If set to true, will allow users to add comments to public collections. Users need not have editing permissions for a collection they wish to add comments to. They just need to have an account on that Greenstone Digital Library. (was AllowUserComments prior to 3.10)
-|[[en:user_advanced:web_editor|AllowDocumentEditing]]|true|display|If set to true (or is absent), will allow authenticated users (that have been assigned the correct group) the ability to edit document text and metadata through the web site. Set this to false to disable document editing. (since 3.09)|+|[[en:user_advanced:web_editor|allowDocumentEditing]]|true|display|If set to true (or is absent), will allow authenticated users (that have been assigned the correct group) the ability to edit document text and metadata through the web site. Set this to false to disable document editing. (since 3.09, was AllowDocumentEditing for 3.09)| 
 +|[[en:user_advanced:web_editor|allowMapGPSEditing]]|true|display|If set to true (or is absent), will allow authenticated users (that have been assigned the correct group) the ability to add and edit GPS data through the web site. Set this to false to disable the Map GPS editing controls. (since 3.10)|
  
-===== Parameter Defaults =====+==== Parameter Defaults ====
  
 Inside a format element you can set default values for parameters, using the following syntax Inside a format element you can set default values for parameters, using the following syntax
Line 45: Line 56:
 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 inside GLI (or directly added to the collectionConfig.xml file). +These can be added inside the <search> and <display> format statements using GLI or directly editing  the collectionConfig.xml file).
-===== Templates =====+
  
-^Format Element^Greenstone2 equivalent^Description^ +==== Templates ==== 
-|     ||| + 
-|''<gsf:template match="documentNode"></gsf:template>'' |Templates are the containers that hold all format statements. The value of ''match'' determines which part of the page content the template applies to.+Templates are the containers that hold all format statements. The value of ''match'' determines which part of the page content the template applies to. For example,  
 +''<gsf:template match="documentNode">template definition </gsf:template>''  matches a documentNode element.
  
-===== Links =====+===== What can go inside a template? ===== 
 +==== Links ====
  
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
Line 71: Line 83:
 |''<gsf:link type='equivdoc'/>'' |  |Link to equivalent documents| |''<gsf:link type='equivdoc'/>'' |  |Link to equivalent documents|
  
-===== Icons and Images =====+==== Icons and Images ====
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
 |     ||| |     |||
Line 87: Line 99:
 |''<gsf:image type='cover'/>''| ''<img src='[DocImage]'/>'' | Displays the document's cover image (if there is one)| |''<gsf:image type='cover'/>''| ''<img src='[DocImage]'/>'' | Displays the document's cover image (if there is one)|
 |''<gsf:image type='cover' height='40'/>''| ''[<img src='[DocImage]' height='40'/>'' | <gsf:image> can take any html img attributes - they will be copied to the resulting <img> element.| |''<gsf:image type='cover' height='40'/>''| ''[<img src='[DocImage]' height='40'/>'' | <gsf:image> can take any html img attributes - they will be copied to the resulting <img> element.|
-===== Text and Metadata =====+ 
 +==== Text and Metadata ====
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
 |     ||| |     |||
Line 105: Line 118:
 |''<gsf:metadata name='Language' format='format-Language'/>'' |The value of a metadata element for the current document, formatted in some way. format-Language: turns language code into language name, e.g. 'en' into 'English'.| |''<gsf:metadata name='Language' format='format-Language'/>'' |The value of a metadata element for the current document, formatted in some way. format-Language: turns language code into language name, e.g. 'en' into 'English'.|
  
-==== gsf:metadata modifiers ====+=== gsf:metadata modifiers ===
  
 By default, gsf:metadata displays all values of the specified metadata field, for the current page or section of a document. You can change which page or section's metadata is output using the **select** attribute. And you can choose just a single value using the **pos** attribute. Or you can set **type='collection'** to retrieve collection level metadata. By default, gsf:metadata displays all values of the specified metadata field, for the current page or section of a document. You can change which page or section's metadata is output using the **select** attribute. And you can choose just a single value using the **pos** attribute. Or you can set **type='collection'** to retrieve collection level metadata.
Line 145: Line 158:
  
  
-===== Miscellaneous Things =====+==== Miscellaneous Things ====
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
 |     ||| |     |||
Line 154: Line 167:
 |''<gsf:collectionText name='xxx'/>'' |Display the xxx from the current collection's colname.properties file (found in resources folder inside the collection) | |''<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: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.|
  
-===== Conditional =====+==== Conditional ====
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
 |     ||| |     |||
Line 164: Line 178:
  
  
-====Preprocess Options ====+===Preprocess Options ===
 The preprocess attribute specifies something to do to the metadata value before performing the test. For example, you may want to lower case the value before comparing it to your text string. That way you don't need to worry about handling case variation in the metadata value. The preprocess attribute specifies something to do to the metadata value before performing the test. For example, you may want to lower case the value before comparing it to your text string. That way you don't need to worry about handling case variation in the metadata value.
  
Line 178: Line 192:
  
  
-==== Test options ====+=== Test options ===
 Sometimes you may want to output different things depending on the value of the metadata element. There are many tests you can make on the metadata value, listed below, which are specified using the test attribute. They all take a second parameter, specified using the test-value attribute, which is the value to compare to (with the exception of exists, which needs no test value). The preprocessing Sometimes you may want to output different things depending on the value of the metadata element. There are many tests you can make on the metadata value, listed below, which are specified using the test attribute. They all take a second parameter, specified using the test-value attribute, which is the value to compare to (with the exception of exists, which needs no test value). The preprocessing
 option, if specified, is carried out first, before performing the test. option, if specified, is carried out first, before performing the test.
Line 198: Line 212:
  
  
-===== Iteration =====+==== Iteration ====
 ^Format Element^Greenstone2 equivalent^Description^ ^Format Element^Greenstone2 equivalent^Description^
 |     ||| |     |||
Line 205: Line 219:
  
  
-==== gsf:foreach-metadata attributes ====+=== gsf:foreach-metadata attributes ===
  
 ^gsf:foreach-metadata Attribute^Possible Values^Description^ ^gsf:foreach-metadata Attribute^Possible Values^Description^
Line 219: Line 233:
 |sort|true|Sort the metadata values (alphabetically, ascending order)| |sort|true|Sort the metadata values (alphabetically, ascending order)|
  
-==== gsf:sort attributes ====+=== gsf:sort attributes ===
  
 ^gsf:sort Attribute^Possible Values^Description^ ^gsf:sort Attribute^Possible Values^Description^
Line 228: Line 242:
 |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|
  
-===== 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.txt · Last modified: 2024/03/11 20:16 by kjdon