source: trunk/gsdl/macros/garish.dm@ 5830

Last change on this file since 5830 was 5830, checked in by nzdl, 20 years ago

uncommented one more thing

  • Property svn:keywords set to Author Date Id Revision
File size: 10.2 KB
Line 
1## Introduction to customising the appearance of a Greenstone Collection.
2##
3## You will need to know some basic HTML coding to edit this file.
4##
5## This file overrides some of the default macros used by greenstone. I've
6## tried to explain what each custom macro does, so hopefully it is
7## straight-forward. I'm sure it looks a little daunting at first, but the
8## use of macros gives you lots of flexibility for modifying pages, once
9## you get the hang of it.
10
11## -- John McPherson, 18 June 2003
12
13######################################################
14## General comments and hints
15
16## In these macro files, the '#' is the start of a comment. Greenstone will
17## ignore everything after a '#' until the end of the line, unless it
18## is part of a macro.
19
20## In the file gsdl/etc/main.cfg, add this file (garish.dm) to the
21## "macrofiles" list so that greenstone starts including this file.
22## (You can add a "\" at the end of the line to continue onto the next one.)
23## You could also have a look at the "yourhome.dm" macro file for
24## customising the main home page.
25
26## Every page action in greenstone has a name. We call it a "package".
27## So the default action is the "about" package. (This is the p=about cgi
28## argument). Other common actions are "document" and "help".
29## If a macro isn't found that is specific to that action, then greenstone
30## will fall back to macros defined in the "Global" package.
31## All macros in this file belong to whichever package was the most recently
32## mentioned one, with a line such as "package Global".
33
34## macros can have optional parameters, that make them more specific.
35## For example, you could have _macro_ {general case} as well as
36## _macro_ [c=garish] {For garish only} for when the "c" argument (which means
37## the collection) is set to "garish".
38
39## Don't refer to a macro's name inside the same macro, otherwise greenstone
40## will go into a recursive loop printing out the macro...
41
42## I've put HTML comments like <!-- end of custom header --> in the macros
43## so that you can see them when you do "view source" on a web page, to
44## help see the effect of changes of these macros.
45
46## _httpimg_ is a macro that expands to the correct directory where images
47## are stored. I suggest you make a subdirectory in the images directory
48## specific for your collection. Or create a directory "gsdl/images/custom"
49## for all your customisations.
50
51## The macros below modify the appearance of a specific greenstone collection.
52## It makes all the pages include a style-sheet, so that you can put
53## html-related appearance stuff (such as font colours and faces) in there,
54## rather than editing the macros for each piece of text.
55## mozilla has excellent CSS support - Netscape 4 and IE both have
56## incomplete implementations, but mostly work with the simple CSS I've used
57## here as a demonstration.
58##
59## Edit the file images/garish/style.css to change the colours and fonts.
60
61
62##############################################################################
63package Global
64##############################################################################
65## default macros - can be overridden by specific packages. The normal versions
66## of these macros are in the file base.dm (and in the language-specific
67## macro files such as english.dm and french.dm)
68
69
70## These 2 macros are used for highlighting text that matched a query when
71## displaying a document. The default is to set the background to yellow.
72##
73## Note - this is a joke. Please don't ever use the blink tag in real life :)
74#_starthighlight_ [c=garish] {<blink>}
75#_endhighlight_ [c=garish] {</blink>}
76
77
78## imagespacer - this is what goes between the search button and the
79## classifier buttons in the navigation bar. The default is the
80## horizontal green bar. You can put any html in here, and you can use
81## the _widthtspace_ macro if you want the calculated gap between the
82## buttons.
83
84## Unfortunately the internally-defined _navigationbar_ macro has no-break tags
85## around it, so we'll close the nobr tags for each button.
86## This stacks the buttons vertically, one above the other.
87#
88## Note - netscape 4.x needs a space between the br and the /
89#_imagespacer_ [c=garish] { </nobr><br /><nobr> }
90
91## If you don't like the look of that, you could comment the above line out
92## and uncomment one of the following definitions for imagespacer:
93
94## This will stack the buttons one above the other (they are in a table) with
95## our image as separator. This closes the current row and starts a new one.
96## This will use our custom image in the images/garish directory.
97
98_imagespacer_ [c=garish] { </nobr>
99<br /><img src="_httpimg_/garish/horzline.gif" width="87" height="17">
100<br />
101<nobr>
102}
103
104## This uses our custom image instead of the green bar, but otherwise has the
105## buttons horizontally, just like the default.
106#
107#_imagespacer_ [c=garish] {
108# <img src="_httpimg_/garish/horzline.gif" width="_widthtspace_"
109# height="17">
110#}
111
112
113## In the language-specific macro files, there are definitions for all of
114## the buttons. Unfortunately they have rather cryptic names. For example,
115## the "Titles A-Z" button has three macros, one for "green" (ie when it is
116## the selected button), one for "off" (when it isn't the selected page),
117## and one for "on" (when the mouse is over the image). It gets prepended
118## "httpicon", so we could override them here. Uncomment the following 3
119## macros to use the custom "title a-z" buttons (and the width macro).
120
121_httpiconttitlgr_ [c=garish] {_httpimg_/garish/title_gr.gif}
122## make it the same as off
123_httpiconttitlon_ [c=garish] {_httpiconttitlof_}
124_httpiconttitlof_ [c=garish] {_httpimg_/garish/title_bn.gif}
125
126## We also need to specify the width of the icons
127_widthttitlx_ [c=garish] {59}
128
129##
130## Note that the above is only for English - if you want custom icons for
131## other languages, you need (eg for French, which is l=fr):
132##
133##_httpiconttitlgr_ [c=garish,l=fr] {_httpimg_/garish/fr_title_green.gif}
134##_httpiconttitlon_ [c=garish,l=fr] {_..._}
135##_httpiconttitlof_ [c=garish,l=fr] {_httpimg_/garish/fr_title_button.gif}
136
137## See english.dm for a list of graphical button names - they all start
138## with "_httpicon".
139
140
141##############################################################################
142package Style
143##############################################################################
144
145## Style package is responsible for creating the header and footer of every
146## page. This is special as there is no style action as such - the other
147## actions include macros from here.
148
149## htmlhead is used by the default _header_ macros. It prints out the
150## beginning of an html file, including the header. We can override it here
151## so that all pages will use our custom style sheet. Includes some javascript
152## functions for rollover of images.
153_htmlhead_ [c=garish] {<html>
154<head>
155 <title>_pagetitle_</title>
156 <link rel="stylesheet" href="_httpimg_/garish/style.css" type="text/css"/>
157 _globalscripts_
158 </head>
159<body>
160<!-- end of custom style:htmlhead -->
161}
162
163
164## The default _pagebanner_ includes the collection's logo, the
165## home/help/preferences buttons, and a large image that says whether
166## you're viewing the about page, the search page, the titles page, etc.
167
168## Uncomment this or define style:pagebanner to something else if you don't
169## want any of those images appearing
170
171_pagebanner_ [c=garish] {}
172
173##############################################################################
174package about
175##############################################################################
176## "about" is page you see when you first go to a collection. The default
177## versions of these macros are in the about.dm file.
178
179## content by default has the navigationbar (links to Search and classifiers),
180## and "About this collection" and "how to find information" text.
181## The _navigationbar_ macro is defined internally by the greenstone server,
182## and uses the _imagespacer_ macro defined in the Global section.
183##
184## This is similar to the default, except we don't centre the _navigationbar_
185## and we don't include a search box on the collection's about page.
186_content_ [c=garish] {
187<!-- start of custom about:content -->
188_navigationbar_
189
190_textabout_
191
192<h3>_help:textsimplehelpheading_</h3>
193_help:simplehelp_
194
195<!-- end of custom about:content -->
196}
197
198
199##############################################################################
200package query
201##############################################################################
202## These are macros related to creating the search page. The default versions
203## are in the file query.dm
204
205
206## This is similar to the default, except we don't centre the _navigationbar_
207## and we've removed the green bars.
208_content_ [c=garish] {
209<!-- start of custom query:content -->
210_navigationbar_
211
212<center>
213_If_(_cgiargct_,_selectqueryform_,_queryform_)
214</center>
215_If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br>
216<center>
217_searchhistorylist_
218</center>)
219_If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br>_resultline_,)
220<br>
221<!-- end of custom query:content -->
222}
223
224
225##############################################################################
226package document
227##############################################################################
228## These are macros related to creating a document page. The default versions
229## are in the file document.dm. Note that technically, the classifiers are
230## also document pages (eg the title lists).
231
232## Note that the server overrides the _header_ macro if we are "not at the
233## top level", which basically means that when viewing a document (and not
234## a classifier), there won't be a heading.
235##
236## We can get around this by re-defining the textheader macro to output
237## What we want (instead of the normal version in document.dm). We force
238## it to use the "Global" version of the header macro instead of the "document"
239## version, which gets overridden to nothing. This also adds in the normal
240## links and navigation buttons as found on the about and search pages.
241_textheader_ [c=garish] {
242<!-- start of custom document:textheader -->
243_cgihead_
244_Global:header_
245<!-- end of custom document:textheader -->
246}
247
248
249## Override the default so that we are not centering the navigation bar.
250## The library will automatically output the document after this.
251_content_ [c=garish] {
252<!-- start of custom document:content -->
253_navigationbar_
254<p>
255<center>
256_phindclassifier_
257</center>
258<!-- end of custom document:content -->
259}
Note: See TracBrowser for help on using the repository browser.