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/26 01:06] – [Sample Greenstone3 Format Statements] kjdon | en:user:gs3_sample_format_statements [2016/09/26 22:51] – [Linking metadata to a search] kjdon | ||
---|---|---|---|
Line 152: | Line 152: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Linking metadata to a search ===== | ||
+ | |||
+ | 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 " | ||
+ | |||
+ | The XML for the links looks something like the following: | ||
+ | |||
+ | < | ||
+ | Search for Authors: < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | The parameters are: | ||
+ | * qs=1 - this search is a quick search. Can omit if you want to be taken to the TextQuery search page (equivalent to clicking the TextQuery link under the quick search form) | ||
+ | * rt=rd - this determines, for a query, if you are displaying the search form, and performing the search or not. If you have qs=1, then you really only need rt=r here. But without qs=1, having the r will perform the search, and having the d will display the search form too. | ||
+ | * startPage=1 | ||
+ | * s1.level=Doc | ||
+ | * s1.query | ||
+ | * s1.index=CR | ||
+ | |||
en/user/gs3_sample_format_statements.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1