Writing /var/www/dokuwiki/greenstone-wiki/private/data/log/error/2025-05-02.log failed
en:user:gs2_format_statements
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:user:gs2_format_statements [2016/02/15 01:43] – created kjdon | en:user:gs2_format_statements [2023/03/13 01:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Greenstone 2 Format | + | |
- | [[en:user:list_of_format_options|List of Format Options]] | + | |
+ | |||
+ | ======Greenstone 2 Formatting====== | ||
+ | |||
+ | |||
+ | =====Site-wide formatting options===== | ||
+ | These should be placed in // | ||
+ | |||
+ | Syntax: **SiteFormat < | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |HomePageCols int|Set the number of columns used to display collections on the home page. Default: 3| | ||
+ | |HomePageType pulldown |Display the collection list on the home page as a pulldown menu, rather than using the default table of collection images. This alters the html that appears in the dynamically generated _homeextra_ macro. You can then move this macro around in home.dm. Default: not set| | ||
+ | |||
+ | |||
+ | =====Collection-specific formatting options===== | ||
+ | These should be placed in // | ||
+ | |||
+ | Syntax: **format < | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |DocumentImages true/ | ||
+ | |DocumentTitles true/ | ||
+ | |DocumentHeading formatstring|This is used for a document heading at the top left if DocumentImages is false and DocumentTitles is true. Default: //< | ||
+ | |DocumentContents true/false| Display table of contents (if document is hierarchical), | ||
+ | |DocumentButtons string|Controls the buttons that are displayed on a document page. Valid options are Detach, Highlight, Expand Text, Expand Contents. Should be separated by < | ||
+ | |DocumentText formatstring|Format | ||
+ | |DocumentArrowsTop true/ | ||
+ | |DocumentArrowsBottom true/ | ||
+ | |DocumentSearchResultLinks true/ | ||
+ | |DocumentUseHTML true/ | ||
+ | |NavigationBar pulldown|If set, provides a drop down list in place of the usual navigation bar (that contains search and classifier options). This alters the html that appears in the dynamically generated // | ||
+ | |AllowExtendedOptions true/ | ||
+ | |SearchTypes string | Controls whether plain and/or form search interfaces should be available for the collection (for mgpp and lucene collections only). Can be one or both of " | ||
+ | |AllowUserComments true/ | ||
+ | |||
+ | =====Formatting Lists===== | ||
+ | The standard use of format statements is for the lists in search results, classifiers etc. Here is a list of the various lists available for format, and what they control. Note that classifiers are numbered from 1 upwards, in the order that they appear in the config file. The value for all of these is a format string. | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |VList|Applies to all vertical lists, unless overridden by a more specific format item. These include search results, classifier lists, and document table of contents| | ||
+ | |HList|Applies to all horizontal lists. Horizontal lists are often used in classifiers, | ||
+ | |DateList|Applies to all date lists - these are the vertical lists generated by a DateList classifier.| | ||
+ | |SearchVList|The vertical list of search results| | ||
+ | |DocumentVList|The document table of contents| | ||
+ | |CL1VList|Applies only to the vertical list of classifier 1| | ||
+ | |CL1HList|Applies only to the horizontal list of classifier 1| | ||
+ | |CL1DateList|Applies only to the DateList in classifier 1| | ||
+ | |||
+ | |||
+ | =====Formatstring items===== | ||
+ | |||
+ | Format strings (for lists, and document display) can contain html, plus the following special format items. | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |[link][/ | ||
+ | |[href]|The href of the link to the document (Greenstone version), without the & | ||
+ | |[srclink][/ | ||
+ | |[equivDocLink][/ | ||
+ | |[icon]|An appropriate icon for a classifier/ | ||
+ | |[srcicon]|An appropriate icon for the original source document. E.g. Word, PDF, PS icon.| | ||
+ | |[equivDocIcon]|An appropriate icon for a document that has been associated using the plugin option // | ||
+ | |[num]|The document number (position in the search results - useful for debugging)| | ||
+ | |[numleafdocs]|The number of documents below the current classifier node. This is often used as a test for classifier nodes, as numleafdocs will not be set for documents. This allows different formatting for classifier nodes and document nodes in a hierarchy.| | ||
+ | |[Text]|The text of the current section| | ||
+ | |[RelatedDocuments]|Related Documents info (if available). This is a vertical list of Titles (or Subjects if Titles aren't available) that link to the related documents. It is based on " | ||
+ | |[highlight][/ | ||
+ | |[Summary]|Displays Summary metadata if available, otherwise displays a short summary created on the fly.| | ||
+ | |[DocOID]|The internal identifier of the current section of the document| | ||
+ | |[DocTopOID]|The (top level) internal identifier of the current document (available 2.72)| | ||
+ | |[DocRank]|The rank of the current document - used in search results| | ||
+ | |[DocImage]|The URL to the cover image of the document| | ||
+ | |[collection]|The directory name of the collection this document is from - useful in cross-collection searching. (version 2.61)| | ||
+ | |[collection: | ||
+ | |[metadata-name]|The value of this metadata element for the document| | ||
+ | |||
+ | =====Extended metadata names===== | ||
+ | There are a few options for displaying metadata. The basic way is to specify e.g. [Title] or [dc.Title]: this displays the value of that particular metadata element for the current document/ | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |[parent: | ||
+ | |[parent(Top): | ||
+ | |[parent(All): | ||
+ | |[parent(All': | ||
+ | |[child: | ||
+ | |[child(All' | ||
+ | |[child(2): | ||
+ | |[child(last): | ||
+ | |[sibling: | ||
+ | |[sibling(All'< | ||
+ | |[sibling(2): | ||
+ | |[sibling(last): | ||
+ | |[parent: | ||
+ | |[child: | ||
+ | |[cgisafe: | ||
+ | |[cgisafe: | ||
+ | |[format: | ||
+ | |[format: | ||
+ | |||
+ | =====Extended Formatstring items===== | ||
+ | These items are only available if AllowExtendedOptions is true. | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |[DocumentButtonDetach]|The Detach button| | ||
+ | |[DocumentButtonHighlight]|The Highlight button| | ||
+ | |[DocumentButtonExpandText]|The Expand Text button| | ||
+ | |[DocumentButtonExpandContents]|The Expand Contents button| | ||
+ | |[DocTOC]|The table of contents for a hierarchical document, or the next/ | ||
+ | |||
+ | =====Conditional expressions in formatstrings===== | ||
+ | |||
+ | ^Item^Description^ | ||
+ | |{If}{[metadata], | ||
+ | |{Or}{[metadata], | ||
+ | |nested If/Or|{Or} can have another conditional as its final option, eg {Or}{[BookTitle], | ||
+ | |{If}{[metadata] op value, action-if-true, | ||
+ | |||
+ | ^String^Numeric^Meaning^ | ||
+ | |eq|==|equals| | ||
+ | |ne|!=|not equals| | ||
+ | |gt|> | ||
+ | |ge|> | ||
+ | |lt|< | ||
+ | |le|< | ||
+ | |sw| |starts with| | ||
+ | |ew| |ends with| | ||
Line 11: | Line 136: | ||
===== Additional Resources ===== | ===== Additional Resources ===== | ||
- | As writing format statements can be tricky, we have a [[en:user:sample_format_statements|sample format statements]] page, which provides sample code for the following: | + | As writing format statements can be tricky, we have a [[en:user:gs2_sample_format_statements|sample format statements]] page, which provides sample code for the following: |
- | * [[en:user:sample_format_statements# | + | * [[en:user:gs2_sample_format_statements# |
- | * [[en:user:sample_format_statements#Hiding the "This document has no text" dummy text]] | + | * [[en:user:gs2_sample_format_statements#Hiding the "This document has no text" dummy text]] |
- | * [[en:user:sample_format_statements# | + | * [[en:user:gs2_sample_format_statements# |
- | * [[en:user:sample_format_statements#Reference an associated image]] | + | * [[en:user:gs2_sample_format_statements#Reference an associated image]] |
- | * [[en:user:sample_format_statements#Linking to other sections of a document]] | + | * [[en:user:gs2_sample_format_statements#Linking to other sections of a document]] |
- | * [[en:user:sample_format_statements#Linking to the next or previous search result from a document page]] | + | * [[en:user:gs2_sample_format_statements#Linking to the next or previous search result from a document page]] |
- | * [[en:user:sample_format_statements#Add a Facebook " | + | * [[en:user:gs2_sample_format_statements#Add a Facebook " |
- | * [[en:user:sample_format_statements#Displaying file size in kB or MB]] | + | * [[en:user:gs2_sample_format_statements#Displaying file size in kB or MB]] |
- | * [[en:user:sample_format_statements#Linking documents in different collections together]] | + | * [[en:user:gs2_sample_format_statements#Linking documents in different collections together]] |
en/user/gs2_format_statements.1455500589.txt.gz · Last modified: 2016/02/15 01:43 by kjdon