source: main/tags/2.51-jcdl/gsdl/macros/garish.dm@ 25200

Last change on this file since 25200 was 7503, checked in by davidb, 20 years ago

Modification made to navigation bar so its position in the default location
of the page is optional. Useful when you want to include the navigation
bar somewhere else. It's straightforward enough to add text that include
the navigation bar in the a new place, but without this modification there
is a lot of editing to do to supress it also appearing in its default position.

  • Property svn:keywords set to Author Date Id Revision
File size: 10.3 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_httpiconttitlgr_ [c=garish] {_httpimg_/garish/title_gr.gif}
124## make it the same as off
125_httpiconttitlon_ [c=garish] {_httpiconttitlof_}
126_httpiconttitlof_ [c=garish] {_httpimg_/garish/title_bn.gif}
127
128## We also need to specify the width of the icons
129_widthttitlx_ [c=garish] {59}
130
131##
132## Note that the above is only for English - if you want custom icons for
133## other languages, you need (eg for French, which is l=fr):
134##
135##_httpiconttitlgr_ [c=garish,l=fr] {_httpimg_/garish/fr_title_green.gif}
136##_httpiconttitlon_ [c=garish,l=fr] {_..._}
137##_httpiconttitlof_ [c=garish,l=fr] {_httpimg_/garish/fr_title_button.gif}
138
139## See english.dm for a list of graphical button names - they all start
140## with "_httpicon".
141
142
143##############################################################################
144package Style
145##############################################################################
146
147## Style package is responsible for creating the header and footer of every
148## page. This is special as there is no style action as such - the other
149## actions include macros from here.
150
151## htmlhead is used by the default _header_ macros. It prints out the
152## beginning of an html file, including the header. We can override it here
153## so that all pages will use our custom style sheet. Includes some javascript
154## functions for rollover of images.
155_htmlhead_ [c=garish] {<html>
156<head>
157 <title>_pagetitle_</title>
158 <link rel="stylesheet" href="_httpimg_/garish/style.css" type="text/css"/>
159 _globalscripts_
160 </head>
161<body>
162<!-- end of custom style:htmlhead -->
163}
164
165
166## The default _pagebanner_ includes the collection's logo, the
167## home/help/preferences buttons, and a large image that says whether
168## you're viewing the about page, the search page, the titles page, etc.
169
170## Uncomment this or define style:pagebanner to something else if you don't
171## want any of those images appearing
172
173_pagebanner_ [c=garish] {}
174
175##############################################################################
176package about
177##############################################################################
178## "about" is page you see when you first go to a collection. The default
179## versions of these macros are in the about.dm file.
180
181## content by default has the navigationbar (links to Search and classifiers),
182## and "About this collection" and "how to find information" text.
183## The _navigationbar_ macro is defined internally by the greenstone server,
184## and uses the _imagespacer_ macro defined in the Global section.
185##
186## This is similar to the default, except we don't centre the _navigationbar_
187## and we don't include a search box on the collection's about page.
188_content_ [c=garish] {
189<!-- start of custom about:content -->
190_optnavigationbar_
191
192_textabout_
193
194<h3>_help:textsimplehelpheading_</h3>
195_help:simplehelp_
196
197<!-- end of custom about:content -->
198}
199
200
201##############################################################################
202package query
203##############################################################################
204## These are macros related to creating the search page. The default versions
205## are in the file query.dm
206
207
208## This is similar to the default, except we don't centre the _navigationbar_
209## and we've removed the green bars.
210_content_ [c=garish] {
211<!-- start of custom query:content -->
212_navigationbar_
213
214<center>
215_If_(_cgiargct_,_selectqueryform_,_queryform_)
216</center>
217_If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br>
218<center>
219_searchhistorylist_
220</center>)
221_If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br>_resultline_,)
222<br>
223<!-- end of custom query:content -->
224}
225
226
227##############################################################################
228package document
229##############################################################################
230## These are macros related to creating a document page. The default versions
231## are in the file document.dm. Note that technically, the classifiers are
232## also document pages (eg the title lists).
233
234## Note that the server overrides the _header_ macro if we are "not at the
235## top level", which basically means that when viewing a document (and not
236## a classifier), there won't be a heading.
237##
238## We can get around this by re-defining the textheader macro to output
239## What we want (instead of the normal version in document.dm). We force
240## it to use the "Global" version of the header macro instead of the "document"
241## version, which gets overridden to nothing. This also adds in the normal
242## links and navigation buttons as found on the about and search pages.
243_textheader_ [c=garish] {
244<!-- start of custom document:textheader -->
245_cgihead_
246_Global:header_
247<!-- end of custom document:textheader -->
248}
249
250
251## Override the default so that we are not centering the navigation bar.
252## The library will automatically output the document after this.
253_content_ [c=garish] {
254<!-- start of custom document:content -->
255_navigationbar_
256<p>
257<center>
258_phindclassifier_
259_collageclassifier_
260</center>
261<!-- end of custom document:content -->
262}
Note: See TracBrowser for help on using the repository browser.