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

Last change on this file since 11142 was 10872, checked in by jrm21, 18 years ago

extensive modifications of generated HTML to support HTML4 and CSS.
Style sheets are the images/ directory. This should make it much easier
to make custom themes for collections, merely by modifying the style
sheet.

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