source: documented-examples/trunk/garish-e/macros/extra.dm@ 22968

Last change on this file since 22968 was 22968, checked in by kjdon, 14 years ago

_httpcstyles_ should be _httpcstyle_

  • Property svn:executable set to *
File size: 10.7 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## 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 garish-e/styles/style.css to change the colours and fonts.
72
73
74##############################################################################
75package 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##############################################################################
123package 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="_httpcstyle_/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="_httpcstyle_/style.css" type="text/css"
155 title="Greenstone Style" charset="UTF-8">
156<style type="text/css">
157body.bgimage \{ background-image: none; \}
158a.navlink:hover \{ background-image: url("_httpcimages_/bg_blue.gif"); \}
159</style>
160}
161
162## The default _pagebanner_ includes the collection's logo, the
163## home/help/preferences buttons, and a large image that says whether
164## you're viewing the about page, the search page, the titles page, etc.
165
166## Uncomment this or define style:pagebanner to something else if you don't
167## want any of those images appearing
168
169## Remove banner entirely
170#_pagebanner_ {}
171
172## Just leave in the home button
173_pagebanner_ {
174<div id="banner">
175<div class="pageinfo">
176<p class="bannerlinks">_homelink_</p>
177</div>
178</div>
179}
180
181##############################################################################
182package about
183##############################################################################
184## "about" is page you see when you first go to a collection. The default
185## versions of these macros are in the about.dm file.
186
187## content by default has the navigationbar (links to Search and classifiers),
188## and "About this collection" and "how to find information" text.
189## The _navigationbar_ macro is defined internally by the greenstone server,
190## and uses the _imagespacer_ macro defined in the Global section.
191##
192## This is similar to the default, except that we don't center the navigation
193## bar and don't include a search box on the collection's about page.
194
195
196_content_ {
197<!-- start of custom about:content -->
198_navigationbar_
199<div class="document">
200_textabout_
201
202<div class="section">
203<h3>_help:textsimplehelpheading_</h3>
204_help:simplehelp_
205</div>
206</div>
207<!-- end of custom about:content -->
208}
209
210
211##############################################################################
212package query
213##############################################################################
214## These are macros related to creating the search page. The default versions
215## are in the file query.dm
216
217
218## This is similar to the default, except we don't centre the _navigationbar_
219## and we've removed one of the green bars
220_content_ {
221<!-- start of custom query:content -->
222_navigationbar_
223
224<div class="document">
225<div class="queryform">
226<center>
227_If_(_cgiargct_,_selectqueryform_,_queryform_)
228</center>
229</div>
230_If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br />
231<center>
232_searchhistorylist_
233</center>)
234_If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br />_resultline_,)
235<br />
236<!-- end of custom query:content -->
237}
238
239
240##############################################################################
241package document
242##############################################################################
243## These are macros related to creating a document page. The default versions
244## are in the file document.dm. Note that technically, the classifiers are
245## also document pages (eg the title lists).
246
247## Note that the server overrides the _header_ macro if we are "not at the
248## top level", which basically means that when viewing a document (and not
249## a classifier), there won't be a heading.
250##
251## We can get around this by re-defining the textheader macro to output
252## what we want (instead of the normal version in document.dm). We copy the
253## Global version of _header_ (from style.dm) and add it as the content of
254## _textheader_. Note that we can't just use
255## _textheader_ {_Global:header_}
256## as any package specific macros (eg _pagetitle_) will no longer be used.
257
258_textheader_ {
259_cgihead_
260_htmlhead_(class="bgimage")_startspacer__pagebanner_
261}
262
263
264## Override the default so that we are not centering the navigation bar.
265## The library will automatically output the document after this.
266_content_ {
267<!-- start of custom document:content -->
268_navigationbar_
269
270_If_(_phindclassifier__collageclassifier_,
271<p style="text-align: center;">
272_phindclassifier_
273_collageclassifier_
274</p>
275)
276
277_If_("_cgiargcl_" eq "search",
278<ul id="searchresults">
279_prevsearchresult_
280_nextsearchresult_
281</ul>)
282
283<div class="document">
284<!-- end of custom document:content -->
285}
Note: See TracBrowser for help on using the repository browser.