en:user:gs3_list_of_format_options
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:user:gs3_list_of_format_options [2017/04/02 23:36] – [Options] kjdon | en:user:gs3_list_of_format_options [2024/06/03 23:50] – [Options] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
====== List of Greenstone3 Format Items ====== | ====== List of Greenstone3 Format Items ====== | ||
- | The full list of formatting items is shown here. There are two main types of format items: options and templates. | + | 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-> |
+ | |||
+ | Format | ||
+ | |||
+ | ''< | ||
+ | |||
+ | |||
See also the description of [[en: | See also the description of [[en: | ||
- | ''< | ||
- | ===== Options ===== | + | ===== Top Level Elements ===== |
+ | |||
+ | There are three main types of format items: options, parameter defaults, and templates. | ||
+ | |||
+ | ==== Options | ||
- | There are a few options available. They are specified by adding < | + | There are a few options available. They are specified by adding |
^Option name^Values^Format^Description^ | ^Option name^Values^Format^Description^ | ||
| |||| | | |||| | ||
|hideStatus|true|search|If set to true, will hide the line ' | |hideStatus|true|search|If set to true, will hide the line ' | ||
- | |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| |
|turnstyleClassifiers|false|browse|By default, bookshelves display a plus icon to open up that section of the classifier in place. < | |turnstyleClassifiers|false|browse|By default, bookshelves display a plus icon to open up that section of the classifier in place. < | ||
|mapEnabled|true|display, | |mapEnabled|true|display, | ||
Line 22: | Line 35: | ||
|sectionExpandCollapse|true|display|? | |sectionExpandCollapse|true|display|? | ||
|backToTopLinks| |display|?| | |backToTopLinks| |display|?| | ||
- | |sideBar| |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 | |
|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| | ||
|coverImage|true|display| | | |coverImage|true|display| | | ||
|TOC|true|display| | | |TOC|true|display| | | ||
- | |viewSelection|true|display| | | + | |viewSelection|false|display|If false, will not show the text/ |
- | |slideShow|true|display| | | + | |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. (was AllowUserComments prior to 3.10)| | ||
+ | |[[en: | ||
+ | |[[en: | ||
+ | |allowGLIEditing|false|display|If set to true (or absent), allows editing of this collection using Webswing GLI| | ||
+ | ==== Parameter Defaults ==== | ||
+ | Inside a format element you can set default values for parameters, using the following syntax | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | You can use this to set things like: | ||
+ | * turn stemming on by default for mgpp collections: | ||
+ | * return all hits in one page instead of paging the results: < | ||
+ | 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 < | ||
- | ===== Templates | + | ==== Templates ==== |
- | ^Format Element^Greenstone2 equivalent^Description^ | + | Templates are the containers that hold all format statements. The value of '' |
- | | ||| | + | ''< |
- | |''< | + | |
+ | ==== Other ==== | ||
+ | |||
+ | The '' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | This will output META tags for any of these metadata elements present for the document, like: | ||
+ | < | ||
+ | <META CONTENT=" | ||
+ | </ | ||
+ | | ||
- | ===== Links ===== | + | ===== What can go inside a template? |
+ | ==== Links ==== | ||
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
Line 49: | Line 93: | ||
|''< | |''< | ||
|''< | |''< | ||
+ | |''< | ||
|''< | |''< | ||
|''< | |''< | ||
Line 58: | Line 103: | ||
|''< | |''< | ||
- | ===== Icons and Images | + | ==== Icons and Images ==== |
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
| ||| | | ||| | ||
Line 74: | Line 119: | ||
|''< | |''< | ||
|''< | |''< | ||
- | ===== Text and Metadata | + | |
+ | ==== Text and Metadata ==== | ||
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
| ||| | | ||| | ||
Line 92: | Line 138: | ||
|''< | |''< | ||
- | ==== gsf: | + | === gsf: |
By default, gsf: | By default, gsf: | ||
^gsf: | ^gsf: | ||
- | |select|current|The current section (this is the default type; if '' | + | |select| |Select a different node or set of nodes, relative to the current node. Only valid for documentNode templates, not in classifierNodes.| |
+ | |:::|current|The current section (this is the default type; if '' | ||
|::: | |::: | ||
|::: | |::: | ||
Line 102: | Line 149: | ||
|::: | |::: | ||
|::: | |::: | ||
- | |::: | + | |::: |
|pos|first, last or any number (1, | |pos|first, last or any number (1, | ||
|::: | |::: | ||
Line 131: | Line 178: | ||
- | ===== Miscellaneous Things | + | ==== Collection/ |
+ | |||
+ | These will be displayed in the current interface language (if available), otherwise in the default language. | ||
+ | |||
+ | ^Format Element^Greenstone2 equivalent^Description^ | ||
+ | | ||| | ||
+ | |''< | ||
+ | |''< | ||
+ | |''< | ||
+ | |''< | ||
+ | |''< | ||
+ | |''< | ||
+ | |||
+ | ==== Miscellaneous Things ==== | ||
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
| ||| | | ||| | ||
|''< | |''< | ||
- | |''< | + | |''< |
- | |'' | + | |
- | |''< | + | |
- | |''< | + | |
|''< | |''< | ||
- | ===== Conditional | + | |
+ | ==== Conditional ==== | ||
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
| ||| | | ||| | ||
Line 150: | Line 208: | ||
- | ====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 164: | Line 222: | ||
- | ==== 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 184: | Line 242: | ||
- | ===== Iteration | + | ==== Iteration ==== |
^Format Element^Greenstone2 equivalent^Description^ | ^Format Element^Greenstone2 equivalent^Description^ | ||
| ||| | | ||| | ||
Line 191: | Line 249: | ||
- | ==== gsf: | + | === gsf: |
^gsf: | ^gsf: | ||
Line 205: | Line 263: | ||
|sort|true|Sort the metadata values (alphabetically, | |sort|true|Sort the metadata values (alphabetically, | ||
- | ==== gsf:sort attributes | + | === gsf:sort attributes === |
^gsf:sort Attribute^Possible Values^Description^ | ^gsf:sort Attribute^Possible Values^Description^ | ||
Line 214: | Line 272: | ||
|data-type|text/ | |data-type|text/ | ||
- | ===== Additional Notes ===== | + | ==== Utility Functions ==== |
+ | |||
+ | There are many utility functions defined in src/ | ||
+ | |||
+ | They can be called explicitly using | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | args is a comma separated list of args. They can be XSLT variables, numbers, strings, XSLT elements/ | ||
+ | |||
+ | For example: | ||
+ | < | ||
+ | < | ||
+ | The collection was last built on < | ||
+ | </ | ||
+ | |||
+ | 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 < | ||
+ | |||
+ | ==== Additional Notes ==== | ||
Some of these options (< | Some of these options (< |
en/user/gs3_list_of_format_options.txt · Last modified: 2024/07/05 00:54 by kjdon