1 | # this file must be UTF-8 encoded
|
---|
2 |
|
---|
3 | ## Introduction to customising the appearance of a Greenstone Collection.
|
---|
4 | ##
|
---|
5 | ## You will need to know some basic HTML coding to edit this file.
|
---|
6 | ##
|
---|
7 | ## This file overrides some of the default macros used by greenstone. I've
|
---|
8 | ## tried to explain what each custom macro does, so hopefully it is
|
---|
9 | ## straight-forward. I'm sure it looks a little daunting at first, but the
|
---|
10 | ## use of macros gives you lots of flexibility for modifying pages, once
|
---|
11 | ## you get the hang of it.
|
---|
12 |
|
---|
13 | ## -- John McPherson, 18 June 2003
|
---|
14 |
|
---|
15 | ######################################################
|
---|
16 | ## General comments and hints
|
---|
17 |
|
---|
18 | ## In these macro files, the '#' is the start of a comment. Greenstone will
|
---|
19 | ## ignore everything after a '#' until the end of the line, unless it
|
---|
20 | ## is part of a macro.
|
---|
21 |
|
---|
22 | ## To change the appearance of your Greenstone library, edit the macro files
|
---|
23 | ## in greenstone/macros. If you need to add a new macro file, you must add it
|
---|
24 | ## to the "macrofiles" list in greenstone/etc/main.cfg so that Greenstone
|
---|
25 | ## will use it.
|
---|
26 |
|
---|
27 | ## To change the appearance of just a single collection, create a file
|
---|
28 | ## called extra.dm in the macros directory of the collection. Collection
|
---|
29 | ## specific macros should be put in there. Macros in this file will override
|
---|
30 | ## the default greenstone macros, just for that collection.
|
---|
31 |
|
---|
32 | ## Every page action in greenstone has a name. We call it a "package".
|
---|
33 | ## So the default action is the "about" package. (This is the p=about cgi
|
---|
34 | ## argument). Other common actions are "document" and "help".
|
---|
35 | ## If a macro isn't found that is specific to that action, then greenstone
|
---|
36 | ## will fall back to macros defined in the "Global" package.
|
---|
37 | ## All macros in this file belong to whichever package was the most recently
|
---|
38 | ## mentioned one, with a line such as "package Global".
|
---|
39 |
|
---|
40 | ## macros can have optional parameters, that make them more specific.
|
---|
41 | ## For example, you could have _macro_ {general case} as well as
|
---|
42 | ## _macro_ [c=garish-e] {For garish-e collection only} for when the
|
---|
43 | # "c" argument (which means the collection) is set to "garish-e".
|
---|
44 | ## Or _macro_ [l=fr] {french case} for
|
---|
45 | ## when the language is set to French. This is how we cope with different
|
---|
46 | ## language interfaces.
|
---|
47 |
|
---|
48 | ## Collection specific macros put into the main macro files must have a
|
---|
49 | ## collection parameter ([c=garish-e]), otherwise they will apply to all
|
---|
50 | ## collections. Macros in a collection's extra.dm do not need this parameter.
|
---|
51 |
|
---|
52 | ## Don't refer to a macro's name inside the same macro, otherwise greenstone
|
---|
53 | ## will go into a recursive loop printing out the macro...
|
---|
54 |
|
---|
55 | ## I've put HTML comments like <!-- end of custom header --> in the macros
|
---|
56 | ## so that you can see them when you do "view source" on a web page, to
|
---|
57 | ## help see the effect of changes of these macros.
|
---|
58 |
|
---|
59 | ## _httpcimages_ is a macro that expands to the images directory of the
|
---|
60 | ## current collection. Any collection images or stylesheets should be put
|
---|
61 | ## there.
|
---|
62 |
|
---|
63 | ## The macros below modify the appearance of a specific greenstone collection.
|
---|
64 | ## It makes all the pages include a style-sheet, so that you can put
|
---|
65 | ## html-related appearance stuff (such as font colours and faces) in there,
|
---|
66 | ## rather than editing the macros for each piece of text.
|
---|
67 | ## mozilla has excellent CSS support - Netscape 4 and IE both have
|
---|
68 | ## incomplete implementations, but mostly work with the simple CSS I've used
|
---|
69 | ## here as a demonstration.
|
---|
70 | ##
|
---|
71 | ## Edit the file images/garish-e/style.css to change the colours and fonts.
|
---|
72 |
|
---|
73 |
|
---|
74 | ##############################################################################
|
---|
75 | package Global
|
---|
76 | ##############################################################################
|
---|
77 | ## default macros - can be overridden by specific packages. The normal versions
|
---|
78 | ## of these macros are in the file base.dm (and in the language-specific
|
---|
79 | ## macro files such as english.dm and french.dm)
|
---|
80 |
|
---|
81 | ## These 2 macros are used for highlighting text that matched a query when
|
---|
82 | ## displaying a document. The default is to set the background to yellow.
|
---|
83 | ##
|
---|
84 | ## Note - this is a joke. Please don't ever use the blink tag in real life :)
|
---|
85 | #_starthighlight_ {<blink>}
|
---|
86 | #_endhighlight_ {</blink>}
|
---|
87 |
|
---|
88 | _starthighlight_ {<b>}
|
---|
89 | _endhighlight_ {</b>}
|
---|
90 |
|
---|
91 | ## navbarspacer - this is what goes between the search button and the
|
---|
92 | ## classifier buttons in the navigation bar. The default is the
|
---|
93 | ## horizontal green bar. You can put any html in here, and you can use
|
---|
94 | ## the _widthtspace_ macro if you want the calculated gap between the
|
---|
95 | ## buttons.
|
---|
96 | ## Note, navigation bar macros are defined in nav_css.dm, not base.dm
|
---|
97 |
|
---|
98 | ## Note - netscape 4.x needs a space between the br and the /
|
---|
99 | #_navbarspacer_ {<br />}
|
---|
100 |
|
---|
101 | ## If you don't like the look of that, you could comment the above line out
|
---|
102 | ## and uncomment one of the following definitions for navbarspacer:
|
---|
103 |
|
---|
104 | ## This will stack the buttons one above the other (they are in a table) with
|
---|
105 | ## our image as separator. This closes the current row and starts a new one.
|
---|
106 | ## This will use our custom image in the collection's images directory.
|
---|
107 |
|
---|
108 | _navbarspacer_ {
|
---|
109 | <br /><img src="_httpcimages_/horzline.gif" width="87" height="17">
|
---|
110 | <br />
|
---|
111 | }
|
---|
112 |
|
---|
113 | ## This uses our custom image instead of the green bar, but otherwise has the
|
---|
114 | ## buttons horizontally, just like the default.
|
---|
115 | #
|
---|
116 | #_navbarspacer_ {
|
---|
117 | # <img src="_httpcimages_/horzline.gif" width="_widthtspace_"
|
---|
118 | # height="17">
|
---|
119 | #}
|
---|
120 |
|
---|
121 |
|
---|
122 | ##############################################################################
|
---|
123 | package Style
|
---|
124 | ##############################################################################
|
---|
125 |
|
---|
126 | ## Style package is responsible for creating the header and footer of every
|
---|
127 | ## page. This is special as there is no style action as such - the other
|
---|
128 | ## actions include macros from here.
|
---|
129 |
|
---|
130 | ## htmlhead is used by the default _header_ macros. It prints out the
|
---|
131 | ## beginning of an html file, including the header. It includes the
|
---|
132 | ## _cssheader_ macro, which links to external stylesheets, and includes
|
---|
133 | ## some image declarations. To override the entire style, write a new
|
---|
134 | ## _cssheader_ macro here
|
---|
135 |
|
---|
136 | #_cssheader_ {
|
---|
137 | #<link rel="stylesheet" href="_httpcimages_/style.css" type="text/css"
|
---|
138 | # title="Garish style Style" charset="UTF-8">
|
---|
139 | #}
|
---|
140 |
|
---|
141 | ## To keep most of the standard greenstone style, and just override a few
|
---|
142 | ## style declarations, we can define _collectionspecificstyle_, which is
|
---|
143 | ## included in the default _cssheader_ macro. The title of a stylesheet
|
---|
144 | ## link must be 'Greenstone Style', in order for it to be used in
|
---|
145 | ## conjunction with the main stylesheet.
|
---|
146 |
|
---|
147 | ## Here we include the garish-e collection's stylesheet, which defines the
|
---|
148 | ## page color to pink.
|
---|
149 | ## We also remove the background image for the page to get rid of the green
|
---|
150 | ## swirly bar, and specify a new (blue) background image for hover
|
---|
151 | ## (mouse over) on the navigation bar buttons
|
---|
152 |
|
---|
153 | _collectionspecificstyle_ {
|
---|
154 | <link rel="stylesheet" href="_httpcimages_/style.css" type="text/css"
|
---|
155 | title="Greenstone Style" charset="UTF-8">
|
---|
156 | <style>
|
---|
157 | body.bgimage \{ background-image: none; \}
|
---|
158 | a.navlink:hover \{ background-image: url("_httpcimages_/bg_blue.gif"); \}
|
---|
159 | </style>
|
---|
160 |
|
---|
161 | }
|
---|
162 |
|
---|
163 | ## The default _pagebanner_ includes the collection's logo, the
|
---|
164 | ## home/help/preferences buttons, and a large image that says whether
|
---|
165 | ## you're viewing the about page, the search page, the titles page, etc.
|
---|
166 |
|
---|
167 | ## Uncomment this or define style:pagebanner to something else if you don't
|
---|
168 | ## want any of those images appearing
|
---|
169 |
|
---|
170 | ## Remove banner entirely
|
---|
171 | #_pagebanner_ {}
|
---|
172 |
|
---|
173 | ## Just leave in the home button
|
---|
174 | _pagebanner_ {
|
---|
175 | <div id="banner">
|
---|
176 | <div class="pageinfo">
|
---|
177 | <p class="bannerlinks">_homelink_</p>
|
---|
178 | </div>
|
---|
179 | </div>
|
---|
180 | }
|
---|
181 |
|
---|
182 | ##############################################################################
|
---|
183 | package about
|
---|
184 | ##############################################################################
|
---|
185 | ## "about" is page you see when you first go to a collection. The default
|
---|
186 | ## versions of these macros are in the about.dm file.
|
---|
187 |
|
---|
188 | ## content by default has the navigationbar (links to Search and classifiers),
|
---|
189 | ## and "About this collection" and "how to find information" text.
|
---|
190 | ## The _navigationbar_ macro is defined internally by the greenstone server,
|
---|
191 | ## and uses the _imagespacer_ macro defined in the Global section.
|
---|
192 | ##
|
---|
193 | ## This is similar to the default, except that we don't center the navigation
|
---|
194 | ## bar and don't include a search box on the collection's about page.
|
---|
195 |
|
---|
196 |
|
---|
197 | _content_ {
|
---|
198 | <!-- start of custom about:content -->
|
---|
199 | _navigationbar_
|
---|
200 | <div class="document">
|
---|
201 | _textabout_
|
---|
202 |
|
---|
203 | <div class="section">
|
---|
204 | <h3>_help:textsimplehelpheading_</h3>
|
---|
205 | _help:simplehelp_
|
---|
206 | </div>
|
---|
207 | </div>
|
---|
208 | <!-- end of custom about:content -->
|
---|
209 | }
|
---|
210 |
|
---|
211 |
|
---|
212 | ##############################################################################
|
---|
213 | package query
|
---|
214 | ##############################################################################
|
---|
215 | ## These are macros related to creating the search page. The default versions
|
---|
216 | ## are in the file query.dm
|
---|
217 |
|
---|
218 |
|
---|
219 | ## This is similar to the default, except we don't centre the _navigationbar_
|
---|
220 | ## and we've removed one of the green bars
|
---|
221 | _content_ {
|
---|
222 | <!-- start of custom query:content -->
|
---|
223 | _navigationbar_
|
---|
224 |
|
---|
225 | <div class="document">
|
---|
226 | <div class="queryform">
|
---|
227 | <center>
|
---|
228 | _If_(_cgiargct_,_selectqueryform_,_queryform_)
|
---|
229 | </center>
|
---|
230 | </div>
|
---|
231 | _If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br />
|
---|
232 | <center>
|
---|
233 | _searchhistorylist_
|
---|
234 | </center>)
|
---|
235 | _If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br />_resultline_,)
|
---|
236 | <br />
|
---|
237 | <!-- end of custom query:content -->
|
---|
238 | }
|
---|
239 |
|
---|
240 |
|
---|
241 | ##############################################################################
|
---|
242 | package document
|
---|
243 | ##############################################################################
|
---|
244 | ## These are macros related to creating a document page. The default versions
|
---|
245 | ## are in the file document.dm. Note that technically, the classifiers are
|
---|
246 | ## also document pages (eg the title lists).
|
---|
247 |
|
---|
248 | ## Note that the server overrides the _header_ macro if we are "not at the
|
---|
249 | ## top level", which basically means that when viewing a document (and not
|
---|
250 | ## a classifier), there won't be a heading.
|
---|
251 | ##
|
---|
252 | ## We can get around this by re-defining the textheader macro to output
|
---|
253 | ## what we want (instead of the normal version in document.dm). We copy the
|
---|
254 | ## Global version of _header_ (from style.dm) and add it as the content of
|
---|
255 | ## _textheader_. Note that we can't just use
|
---|
256 | ## _textheader_ {_Global:header_}
|
---|
257 | ## as any package specific macros (eg _pagetitle_) will no longer be used.
|
---|
258 |
|
---|
259 | _textheader_ {
|
---|
260 | _cgihead_
|
---|
261 | _htmlhead_(class="bgimage")_startspacer__pagebanner_
|
---|
262 | }
|
---|
263 |
|
---|
264 |
|
---|
265 | ## Override the default so that we are not centering the navigation bar.
|
---|
266 | ## The library will automatically output the document after this.
|
---|
267 | _content_ {
|
---|
268 | <!-- start of custom document:content -->
|
---|
269 | _navigationbar_
|
---|
270 |
|
---|
271 | _If_(_phindclassifier__collageclassifier_,
|
---|
272 | <p style="text-align: center;">
|
---|
273 | _phindclassifier_
|
---|
274 | _collageclassifier_
|
---|
275 | </p>
|
---|
276 | )
|
---|
277 |
|
---|
278 | _If_("_cgiargcl_" eq "search",
|
---|
279 | <ul id="searchresults">
|
---|
280 | _prevsearchresult_
|
---|
281 | _nextsearchresult_
|
---|
282 | </ul>)
|
---|
283 |
|
---|
284 | <div class="document">
|
---|
285 | <!-- end of custom document:content -->
|
---|
286 | }
|
---|