# this file must be UTF-8 encoded
## 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 (garish.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=garish] {For garish only} for when the "c" argument (which means
## the collection) is set to "garish".
## 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 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/garish/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=garish] {}
## 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=garish] { }
## 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/garish directory.
_imagespacer_ [c=garish] {
}
## This uses our custom image instead of the green bar, but otherwise has the
## buttons horizontally, just like the default.
#
#_imagespacer_ [c=garish] {
#
#}
## 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).
## make it the same as off
## We also need to specify the width of the icons
_widthttitlx_ [c=garish] {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):
##
## 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. Includes some javascript
## functions for rollover of images.
_htmlhead_ [c=garish] {
_pagetitle_
_globalscripts_
}
## 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=garish] {}
##############################################################################
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.
## 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=garish] {
_optnavigationbar_
_titleabout_
_help:textsimplehelpheading_
_help:simplehelp_
}
##############################################################################
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=garish] {
_navigationbar_
_If_(_cgiargct_,_selectqueryform_,_queryform_)
_If_(_searchhistorylist_,
_iconsearchhistorybar_
_searchhistorylist_
)
_If_(_cgiargq_,_freqmsg_ _textpostprocess_ _resultline_,)
}
##############################################################################
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 copy the
## Global version of _header_ (from style.dm) and add it as the content of
## _textheader_. Note that we can't just use
## _textheader_ [c=garish] {_Global:header_}
## as any package specific macros (eg _pagetitle_) will no longer be used.
_textheader_ [c=garish] {
_cgihead_
_htmlhead_(background="_httpiconchalk_")_startspacer__pagebanner_
}
## Override the default so that we are not centering the navigation bar.
## The library will automatically output the document after this.
_content_ [c=garish] {
_navigationbar_