# 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. ## To change the appearance of your Greenstone library, edit the macro files ## in greenstone/macros. If you need to add a new macro file, you must add it ## to the "macrofiles" list in greenstone/etc/main.cfg so that Greenstone ## will use it. ## To change the appearance of just a single collection, create a file ## called extra.dm in the macros directory of the collection. Collection ## specific macros should be put in there. Macros in this file will override ## the default greenstone macros, just for that collection. ## 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-e] {For garish-e collection only} for when the # "c" argument (which means the collection) is set to "garish-e". ## Or _macro_ [l=fr] {french case} for ## when the language is set to French. This is how we cope with different ## language interfaces. ## Collection specific macros put into the main macro files must have a ## collection parameter ([c=garish-e]), otherwise they will apply to all ## collections. Macros in a collection's extra.dm do not need this parameter. ## 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. ## _httpcimages_ is a macro that expands to the images directory of the ## current collection. Any collection images or stylesheets should be put ## there. ## 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 garish-e/styles/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_ {} #_endhighlight_ {} _starthighlight_ {} _endhighlight_ {} ## navbarspacer - 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. ## Note, navigation bar macros are defined in nav_css.dm, not base.dm ## Note - netscape 4.x needs a space between the br and the / #_navbarspacer_ {
} ## If you don't like the look of that, you could comment the above line out ## and uncomment one of the following definitions for navbarspacer: ## 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 collection's images directory. _navbarspacer_ {

} ## This uses our custom image instead of the green bar, but otherwise has the ## buttons horizontally, just like the default. # #_navbarspacer_ { # #} ############################################################################## 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. It includes the ## _cssheader_ macro, which links to external stylesheets, and includes ## some image declarations. To override the entire style, write a new ## _cssheader_ macro here #_cssheader_ { # #} ## To keep most of the standard greenstone style, and just override a few ## style declarations, we can define _collectionspecificstyle_, which is ## included in the default _cssheader_ macro. The title of a stylesheet ## link must be 'Greenstone Style', in order for it to be used in ## conjunction with the main stylesheet. ## Here we include the garish-e collection's stylesheet, which defines the ## page color to pink. ## We also remove the background image for the page to get rid of the green ## swirly bar, and specify a new (blue) background image for hover ## (mouse over) on the navigation bar buttons _collectionspecificstyle_ { } ## 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 ## Remove banner entirely #_pagebanner_ {} ## Just leave in the home button _pagebanner_ { } ############################################################################## 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 that we don't center the navigation ## bar and don't include a search box on the collection's about page. _content_ { _navigationbar_
_textabout_

_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 one of the green bars _content_ { _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_ {_Global:header_} ## as any package specific macros (eg _pagetitle_) will no longer be used. _textheader_ { _cgihead_ _htmlhead_(class="bgimage")_startspacer__pagebanner_ } ## Override the default so that we are not centering the navigation bar. ## The library will automatically output the document after this. _content_ { _navigationbar_ _If_(_phindclassifier__collageclassifier_,

_phindclassifier_ _collageclassifier_

) _If_("_cgiargcl_" eq "search", )
}