source: gsdl/tags/gsdl-2_40-distribution/gsdl/macros/garish.dm@ 14121

Last change on this file since 14121 was 4775, checked in by sjboddie, 21 years ago

* empty log message *

  • 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. The default one also
152## includes some javascript 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 </head>
158<body>
159<!-- end of custom style:htmlhead -->
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#_pagebanner_ [c=garish] {}
171
172##############################################################################
173package about
174##############################################################################
175## "about" is page you see when you first go to a collection. The default
176## versions of these macros are in the about.dm file.
177
178## content by default has the navigationbar (links to Search and classifiers),
179## and "About this collection" and "how to find information" text.
180## The _navigationbar_ macro is defined internally by the greenstone server,
181## and uses the _imagespacer_ macro defined in the Global section.
182##
183## This is similar to the default, except we don't centre the _navigationbar_
184## and we don't include a search box on the collection's about page.
185_content_ [c=garish] {
186<!-- start of custom about:content -->
187_navigationbar_
188
189_textabout_
190
191<h3>_help:textsimplehelpheading_</h3>
192_help:simplehelp_
193
194<!-- end of custom about:content -->
195}
196
197
198##############################################################################
199package query
200##############################################################################
201## These are macros related to creating the search page. The default versions
202## are in the file query.dm
203
204
205## This is similar to the default, except we don't centre the _navigationbar_
206## and we've removed the green bars.
207_content_ [c=garish] {
208<!-- start of custom query:content -->
209_navigationbar_
210
211<center>
212_If_(_cgiargct_,_selectqueryform_,_queryform_)
213</center>
214_If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br>
215<center>
216_searchhistorylist_
217</center>)
218_If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br>_resultline_,)
219<br>
220<!-- end of custom query:content -->
221}
222
223
224##############################################################################
225package document
226##############################################################################
227## These are macros related to creating a document page. The default versions
228## are in the file document.dm. Note that technically, the classifiers are
229## also document pages (eg the title lists).
230
231## Note that the server overrides the _header_ macro if we are "not at the
232## top level", which basically means that when viewing a document (and not
233## a classifier), there won't be a heading.
234##
235## We can get around this by re-defining the textheader macro to output
236## What we want (instead of the normal version in document.dm). We force
237## it to use the "Global" version of the header macro instead of the "document"
238## version, which gets overridden to nothing. This also adds in the normal
239## links and navigation buttons as found on the about and search pages.
240_textheader_ [c=garish] {
241<!-- start of custom document:textheader -->
242_cgihead_
243_Global:header_
244<!-- end of custom document:textheader -->
245}
246
247
248## Override the default so that we are not centering the navigation bar.
249## The library will automatically output the document after this.
250_content_ [c=garish] {
251<!-- start of custom document:content -->
252_navigationbar_
253<p>
254<center>
255_phindclassifier_
256</center>
257<!-- end of custom document:content -->
258}
Note: See TracBrowser for help on using the repository browser.