Index: /trunk/gsdl/images/custom/style.css
===================================================================
--- /trunk/gsdl/images/custom/style.css	(revision 4734)
+++ /trunk/gsdl/images/custom/style.css	(revision 4734)
@@ -0,0 +1,44 @@
+/* This style sheet is used only by the custom.dm macro as an
+  example of modifying the appearance */
+
+/* notes about style sheets.
+
+   Colours - The most portable way to specify colours is to use the
+     #xxxxxx notation, which is in hex for red, green, and blue.  eg black
+     is #000000, red is #ff0000, blue is #0000ff and white is #ffffff.
+     This may seem confusing at first, but you can't count on colour names
+     being the same across all browsers and platforms. For example,
+     linux/x11 has hundreds of colours with names such as DarkOliveGreen
+     and PaleVioletRed. However, simple colour names should work with most
+     browsers...
+
+*/
+   
+
+/* set defaults for the HTML body */
+body {
+ /* set the face. The first one in the list found will be used, so
+    have reasonable fall-backs */
+ /* use a serif font windows uses "times new roman", "times" on mac/linux */
+  font-family: times new roman, times, serif;
+ /* you can set a background colour, but a lot of the images/buttons are
+    designed to blend into a white background. */
+  background-color: pink;
+}
+
+
+/* paragraph text - this will override the settings above for text inside
+ <p>....</p> tags. Uncomment if you want to test it, although red text with
+ a pink background is pretty ugly :) */
+/*
+p {
+ color: red;
+}
+*/
+
+/* headings */
+h1, h2, h3, h4 {
+ /* use a sans-serif font - arial on windows, helvetica on mac/linux */
+ font-family: arial, helvetica, sans-serif;
+ color: blue;
+}
Index: /trunk/gsdl/macros/custom.dm
===================================================================
--- /trunk/gsdl/macros/custom.dm	(revision 4734)
+++ /trunk/gsdl/macros/custom.dm	(revision 4734)
@@ -0,0 +1,270 @@
+## Introduction to customising the appearance of a Greenstone Collection.
+##
+## You will need to know some basic HTML coding to edit this file.
+##
+## This file overrides some of the default macros used by greenstone. I've
+## tried to explain what each custom macro does, so hopefully it is
+## straight-forward. I'm sure it looks a little daunting at first, but the
+## use of macros gives you lots of flexibility for modifying pages, once
+## you get the hang of it.
+
+##   -- John McPherson, 18 June 2003
+
+######################################################
+## General comments and hints
+
+## In these macro files, the '#' is the start of a comment. Greenstone will
+## ignore everything after a '#' until the end of the line, unless it
+## is part of a macro.
+
+## In the file gsdl/etc/main.cfg, add this file (custom.dm) to the
+## "macrofiles" list so that greenstone starts including this file.
+## (You can add a "\" at the end of the line to continue onto the next one.)
+## You could also have a look at the "yourhome.dm" macro file for
+## customising the main home page.
+
+## Every page action in greenstone has a name. We call it a "package".
+## So the default action is the "about" package. (This is the p=about cgi
+## argument). Other common actions are "document" and "help".
+## If a macro isn't found that is specific to that action, then greenstone
+## will fall back to macros defined in the "Global" package.
+## All macros in this file belong to whichever package was the most recently
+## mentioned one, with a line such as "package Global".
+
+## macros can have optional parameters, that make them more specific.
+## For example, you could have _macro_ {general case} as well as
+## _macro_ [c=demo] {For demo only} for when the "c" argument (which means
+## the collection) is set to "demo".
+
+## Don't refer to a macro's name inside the same macro, otherwise greenstone
+## will go into a recursive loop printing out the macro...
+
+## I've put HTML comments like <!-- end of custom header --> in the macros
+## so that you can see them when you do "view source" on a web page, to
+## help see the effect of changes of these macros.
+
+## _httpimg_ is a macro that expands to the correct directory where images
+## are stored. I suggest you make a subdirectory in the images directory
+## specific for your collection. Or create a directory "gsdl/images/custom"
+## for all your customisations.
+
+## The macros below modify the appearance of a specific greenstone collection.
+## It makes all the pages include a style-sheet, so that you can put
+## html-related appearance stuff (such as font colours and faces) in there,
+## rather than editing the macros for each piece of text.
+## mozilla has excellent CSS support - Netscape 4 and IE both have
+## incomplete implementations, but mostly work with the simple CSS I've used
+## here as a demonstration.
+##
+## Edit the file images/custom/style.css to change the colours and fonts.
+
+
+##############################################################################
+package Global
+##############################################################################
+## default macros - can be overridden by specific packages. The normal versions
+## of these macros are in the file base.dm (and in the language-specific
+## macro files such as english.dm and french.dm)
+
+
+## These 2 macros are used for highlighting text that matched a query when
+## displaying a document. The default is to set the background to yellow.
+##
+## Note - this is a joke. Please don't ever use the blink tag in real life :)
+#_starthighlight_ [c=demo] {<blink>}
+#_endhighlight_ [c=demo] {</blink>}
+
+
+## imagespacer - this is what goes between the search button and the
+## classifier buttons in the navigation bar.  The default is the
+## horizontal green bar.  You can put any html in here, and you can use
+## the _widthtspace_ macro if you want the calculated gap between the
+## buttons.
+
+## Unfortunately the internally-defined _navigationbar_ macro has no-break tags
+## around it, so we'll close the nobr tags for each button.
+## This stacks the buttons vertically, one above the other.
+#
+## Note - netscape 4.x needs a space between the br and the /
+_imagespacer_ [c=demo] { </nobr><br /><nobr> }
+
+## If you don't like the look of that, you could comment the above line out
+## and uncomment one of the following definitions for imagespacer:
+
+## This will stack the buttons one above the other (they are in a table) with
+## our image as separator. This closes the current row and starts a new one.
+## This will use our custom image in the images/custom directory.
+
+#_imagespacer_ [c=demo] { </nobr>
+#<br/><img src="_httpimg_/custom/horzline.gif" width="87" height="17">
+#<br/>
+#<nobr>
+#}
+
+## This uses our custom image instead of the green bar, but otherwise has the
+## buttons horizontally, just like the default.
+#
+#_imagespacer_ [c=demo] {
+# <img src="_httpimg_/custom/horzline.gif" width="_widthtspace_"
+# height="17"> 
+#}
+
+
+## In the language-specific macro files, there are definitions for all of
+## the buttons. Unfortunately they have rather cryptic names. For example,
+## the "Titles A-Z" button has three macros, one for "green" (ie when it is
+## the selected button), one for "off" (when it isn't the selected page),
+## and one for "on" (when the mouse is over the image). It gets prepended
+## "httpicon", so we could override them here. Uncomment the following 3
+## macros to use the custom "title a-z" buttons (and the width macro).
+
+#_httpiconttitlgr_ [c=demo] {_httpimg_/custom/title_gr.gif}
+## make it the same as off
+#_httpiconttitlon_ [c=demo] {_httpiconttitlof_}
+#_httpiconttitlof_ [c=demo] {_httpimg_/custom/title_bn.gif}
+
+## We also need to specify the width of the icons
+#_widthttitlx_ [c=demo] {59}
+
+##
+## Note that the above is only for English - if you want custom icons for
+## other languages, you need (eg for French, which is l=fr):
+##
+##_httpiconttitlgr_ [c=demo,l=fr] {_httpimg_/custom/fr_title_green.gif}
+##_httpiconttitlon_ [c=demo,l=fr] {_..._}
+##_httpiconttitlof_ [c=demo,l=fr] {_httpimg_/custom/fr_title_button.gif}
+
+## See english.dm for a list of graphical button names - they all start
+## with "_httpicon".
+
+
+##############################################################################
+package Style
+##############################################################################
+
+## Style package is responsible for creating the header and footer of every
+## page. This is special as there is no style action as such - the other
+## actions include macros from here.
+
+## htmlhead is used by the default _header_ macros. It prints out the
+## beginning of an html file, including the header. We can override it here
+## so that all pages will use our custom style sheet. The default one also
+## includes some javascript functions for rollover of images.
+_htmlhead_ [c=demo] {<html>
+<head>
+   <title>_pagetitle_</title>
+   <link rel="stylesheet" href="_httpimg_/custom/style.css" type="text/css"/>
+ </head>
+<body>
+<!-- end of custom style:htmlhead -->
+}
+
+
+## The default _pagebanner_ includes the collection's logo, the
+## home/help/preferences buttons, and a large image that says whether
+## you're viewing the about page, the search page, the titles page, etc.
+
+## Uncomment this or define style:pagebanner to something else if you don't
+## want any of those images appearing
+
+#_pagebanner_ [c=demo] {}
+
+##############################################################################
+package about
+##############################################################################
+## "about" is page you see when you first go to a collection. The default
+## versions of these macros are in the about.dm file.
+
+## header by default has the collection's full name, logo, and links for
+## the home, help, and preferences buttons.
+## _header_ is defined in style.dm - it contains _htmlhead_ and _pagebanner_
+## which do most of the work.
+
+#_header_ [c=demo] {<html>
+#<head>
+#   <title>_pagetitle_</title>
+#
+# </head>
+#<body> _pagebanner_}
+
+## content by default has the navigationbar (links to Search and classifiers),
+## and "About this collection" and "how to find information" text.
+## The _navigationbar_ macro is defined internally by the greenstone server,
+## and uses the _imagespacer_ macro defined in the Global section.
+##
+## This is similar to the default, except we don't centre the _navigationbar_
+## and we don't include a search box on the collection's about page.
+_content_ [c=demo] {
+<!-- start of custom about:content -->
+_navigationbar_
+
+_textabout_
+
+<h3>_help:textsimplehelpheading_</h3>
+_help:simplehelp_
+
+<!-- end of custom about:content -->
+}
+
+
+##############################################################################
+package query
+##############################################################################
+## These are macros related to creating the search page. The default versions
+## are in the file query.dm
+
+
+## This is similar to the default, except we don't centre the _navigationbar_
+## and we've removed the green bars.
+_content_ [c=demo] {
+<!-- start of custom query:content -->
+_navigationbar_
+
+<center>
+_If_(_cgiargct_,_selectqueryform_,_queryform_)
+</center>
+_If_(_searchhistorylist_,<center>_iconsearchhistorybar_</center><br>
+<center>
+_searchhistorylist_
+</center>)
+_If_(_cgiargq_,<small>_freqmsg_ _textpostprocess_</small><br>_resultline_,)
+<br>
+<!-- end of custom query:content -->
+}
+
+
+##############################################################################
+package document
+##############################################################################
+## These are macros related to creating a document page. The default versions
+## are in the file document.dm. Note that technically, the classifiers are
+## also document pages (eg the title lists).
+
+## Note that the server overrides the _header_ macro if we are "not at the
+## top level", which basically means that when viewing a document (and not
+## a classifier), there won't be a heading.
+##
+## We can get around this by re-defining the textheader macro to output
+## What we want (instead of the normal version in document.dm). We force
+## it to use the "Global" version of the header macro instead of the "document"
+## version, which gets overridden to nothing. This also adds in the normal
+## links and navigation buttons as found on the about and search pages.
+_textheader_ [c=demo] {
+<!-- start of custom document:textheader -->
+_cgihead_
+_Global:header_
+<!-- end of custom document:textheader -->
+}
+
+
+## Override the default so that we are not centering the navigation bar.
+## The library will automatically output the document after this.
+_content_ [c=demo] {
+<!-- start of custom document:content -->
+_navigationbar_
+<p>
+<center>
+_phindclassifier_
+</center>
+<!-- end of custom document:content -->
+}
