Changeset 8938
- Timestamp:
- 2005-02-01T15:21:34+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/greenorg/macros/english.dm
r8936 r8938 1904 1904 When a metadata element has only one value, it is easy to make a hyperlink out of the value. In the format statement, you just put an <a> tag around the metadata item, for example: 1905 1905 <br><small><tt><a href="url to link to">[dc.Subject]</a></tt></small><br> 1906 When the metadata item has multiple values, and you want to link each one separately, it is a bit more difficult. The following is Axel's solution to his particular problem: display all the Creator elements, each one hyperlinked to a search of that Creator ,in the Creators index.1907 <p> 1908 Use the format string below in the collect.cfg file ( for my collection I put this string in"format DocumentText" statement)1906 When the metadata item has multiple values, and you want to link each one separately, it is a bit more difficult. The following is Axel's solution to his particular problem: display all the Creator elements, each one hyperlinked to a search of that Creator in the Creators index. 1907 <p> 1908 Use the format string below in the collect.cfg file (in this case, as part of the "format DocumentText" statement) 1909 1909 <br><small><tt><pre> 1910 1910 \{If\}\{[dc.Creator], … … 1916 1916 </tr>\} 1917 1917 </pre></tt></small> 1918 This statement includes a label definition with the name "AuthorField". "\_httpquery\_" is a macro which resolves into the http-address of query page of the collection. "[cgisafe:sibling(All:\\' ; \\'):dc.Creator]" displays all Creators, separated by ; with all special characters replaced with UTF-8 encoding, so that it can be used within a web address. [sibling(All:\\'\_\\'):dc.Creator] produces a similar string without replacedspecial characters. Notice the different separation symbols, these are needed later on.1919 <p> 1920 Additional changes have to be made in order to make this whole thing work. You further need to change the \_header\_ or \_textheader\_ macro in the package of the page the format string will be displayed in (in my case the document package). The change is that \_htmlheadhas to be parametrized with1921 1922 <small><tt>\_htmlhead\_(onload="ExtractAuthors();")</tt></small>, where ExtractAuthors(); is a Javasc ipt function, which is called on loading the corresponding page (the document display page). Since you do not want to mess in the standard macro files, create an extra.dm file (should be placed in gsdl/collect/<collnanme>/macros) and override the chosen macro with a collection specific macro. In myexample this is done by the code sequence1918 This statement includes a label definition with the name "AuthorField". "\_httpquery\_" is a macro which resolves into the http-address of the query page of the collection. "[cgisafe:sibling(All:\\' ; \\'):dc.Creator]" displays all Creators, separated by ; and with any special characters escaped for use within a web address. [sibling(All:\\'\_\\'):dc.Creator] produces a similar string without escaping any special characters. Notice the different separation symbols, these are needed later on. 1919 <p> 1920 Additional changes have to be made in order to make this whole thing work. You further need to change the \_header\_ or \_textheader\_ macro in the package of the page the format string will be displayed in (in this case the document package). The change is that \_htmlhead\_ has to be parametrized with 1921 1922 <small><tt>\_htmlhead\_(onload="ExtractAuthors();")</tt></small>, where ExtractAuthors(); is a Javascript function that is called on loading the corresponding page (the document display page). Since you do not want to mess in the standard macro files, create an extra.dm file (in gsdl/collect/<collname>/macros) and override the chosen macro with a collection specific macro. In this example this is done by the code sequence 1923 1923 1924 1924 <br><small><tt><pre> … … 1936 1936 \} 1937 1937 </pre></tt></small> 1938 Now all that is missing is the Javascript function which has to be included into the \_pagescriptextra\_ macro of the same package. Copy this macro out of the corresponding standard macro file and paste it into your extra.dm file. Make the neccessary modification which is in mycase1938 Now all that is missing is the Javascript function which has to be included into the \_pagescriptextra\_ macro of the same package. Copy this macro out of the corresponding standard macro file and paste it into your extra.dm file. Make the neccessary modification which is in this case 1939 1939 <br><small><tt><pre> 1940 1940 ### Self-made Javascript functions … … 1955 1955 \} 1956 1956 </pre></tt></small> 1957 This Javascript function evaluates the string of the defined label, splits it into several strings and composes a string out of thoses values, which is then set to the "outerHTML" element of the label. "&h=dd0" indicates which index to search in, and dd0 should be replaced with the name of the appropriate index. The file gsdl/collect/<collname>/index/build.cfg gives the names of the various indexes. 1958 1957 This Javascript function evaluates the string of the defined label, splits it into several strings and composes a string out of those values, which is then set to the "outerHTML" element of the label. "&h=dd0" indicates which index to search in; dd0 should be replaced with the name of the appropriate index. The file gsdl/collect/<collname>/index/build.cfg gives the names of the various indexes. 1959 1958 } 1960 1959
Note:
See TracChangeset
for help on using the changeset viewer.