en:user:gs3_sample_format_statements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:user:gs3_sample_format_statements [2016/05/12 01:54] – removed kjdon | en:user:gs3_sample_format_statements [2016/09/26 22:24] – [Linking to a search] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | ====== Sample Greenstone3 Format Statements ====== | ||
+ | This page provides examples of format statements for miscellaneous things. See also | ||
+ | * [[en: | ||
+ | * [[en: | ||
+ | * [[en: | ||
+ | |||
+ | ===== Document Display ===== | ||
+ | |||
+ | ==== Linking to Abstract and Commentaries ==== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <div style=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Image Display Example ==== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | | ||
+ | <link href=" | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <div class=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <p> | ||
+ | <i> | ||
+ | < | ||
+ | </i> | ||
+ | </p> | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <h1> | ||
+ | < | ||
+ | </h1> | ||
+ | <ul> | ||
+ | <li> | ||
+ | < | ||
+ | < | ||
+ | </li> | ||
+ | <li> | ||
+ | < | ||
+ | < | ||
+ | </li> | ||
+ | < | ||
+ | </ul> | ||
+ | </ | ||
+ | <br class=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | This code provides a nice way to display images with their metadata on the document display page. Provides an example of gsf:switch and gsf:when statements, as well as linking to a CSS file. | ||
+ | |||
+ | This format statement will display any document with a FileFormat (ex.FileFormat) of | ||
+ | " | ||
+ | dc.Title as a heading and the document text. | ||
+ | |||
+ | If you have images of many different formats (png, jpg, jpeg, gif), you could replace the lines: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | With the following: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | For the image display to appear as shown in the image, | ||
+ | you must include the following CSS in a file called imageDisplay.css in your collection' | ||
+ | |||
+ | < | ||
+ | div.separating-line { | ||
+ | border-bottom: | ||
+ | padding: 5px; | ||
+ | clear: both; | ||
+ | } | ||
+ | |||
+ | div.doc-image { | ||
+ | float: left; | ||
+ | margin-left: | ||
+ | padding-right: | ||
+ | } | ||
+ | |||
+ | div.doc-image img { | ||
+ | border: 1px solid #5d5f60; | ||
+ | padding: 5px; | ||
+ | |||
+ | } | ||
+ | |||
+ | div.doc-quote p { | ||
+ | width: 500px; | ||
+ | } | ||
+ | |||
+ | div.doc-info h4 { | ||
+ | margin-top: 15px; | ||
+ | margin-bottom: | ||
+ | } | ||
+ | |||
+ | div.doc-info ul { | ||
+ | list-style-type: | ||
+ | color: #5d5f60; | ||
+ | margin-top: 0px; | ||
+ | | ||
+ | } | ||
+ | |||
+ | div.doc-info ul li { | ||
+ | line-height: | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Linking to search results ===== | ||
+ | |||
+ | How to link metadata values to a search for that value. | ||
+ | For example, say a document has several authors, stored as dc.Creator metadata. You can display a list of the authors, each one linked to a search of the dc.Creator index for that author. | ||
+ | |||
+ | Collection setup: | ||
+ | * dc.Creator metadata will need to be assigned to the documents | ||
+ | * You need to add a search index on dc.Creator metadata | ||
+ | * Build the collection | ||
+ | |||
+ | You will need to find out the shortname for the dc.Creator index. You can look in web/ | ||
+ | < | ||
+ | < | ||
+ | <index name=" | ||
+ | <index name=" | ||
+ | <index name=" | ||
+ | </ | ||
+ | </ | ||
+ | You can see from this example that the dc.Creator index got the shortname " | ||
+ | |||
+ | |||
+ | Next you need to modify your format statement to add in the search links. If you want these links to appear on the document page, select the " | ||
+ | |||
+ | The default XML for the display format item contains several commented out templates. Say you have simple documents (ie ones with no internal structure eg images), you can add the links to the " | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
en/user/gs3_sample_format_statements.txt · Last modified: 2024/07/05 01:00 by kjdon