Re: How to define a per-collection macro to provide all the "look andfeel"?

From Stefan Boddie
DateTue, 11 Feb 2003 21:10:37 +1300
Subject Re: How to define a per-collection macro to provide all the "look andfeel"?
In-Reply-To (1044771868-1350-16-camel-beowolf-undernet)
Anthony Hornby wrote:
> Hi,
> I hope this is the correct list to post this to, will send to users list
> if not appropriate here.
>

This is probably the right list. The two have become kind of
interchangable but the intention was that greenstone_devl would be used
for queries of a more technical nature (which I guess this is).

> I am trying to work out how to define macros such that they will
> override all the "look and feel" options per collection and was
> wondering what the best way of doing this is.
>
> Can I define all the methods (eg GSDL Error

) in a "collectionstyle.dm"
> type macro to override all the defaults per collection & if so how would
> I call this macro for my desired collection?
>
> Doing this would help maintenance - just have to edit the one file per
> collection.
>

Ok, first create your collectionstyle.dm file in gsdl/macros and edit
the macrofiles field in gsdl/etc/main.cfg to include the new file.

You can override any macros you like in this file, giving each new macro
definition a "[c=mycol]" option so it's only used by the "mycol"
collection (and so it overrides the default macro of the same name and
package). For example, to override the GSDL Error

macro definition in
style.dm you'd use something like the following:

package Style
GSDL Error

[c=mycol] {
<html>
<head><title>this is my new header macro</title></head>
<body>
}

Note that the "package Style" line is important. All macros belong to a
given package as denoted by the most recent "package ..." line before
their definition. If you're trying to override a macro from the
"document", "help", or any other package you must make sure you've got
the correct "package ..." line above them. You can have as many package
lines in your collectionstyle.dm file as you like (see english.dm for an
example of a macro file that includes many packages).

> Also as a side note, How do you get rid of the green stripe down the
> left hand side globally? I uncommented the GSDL Error

definition in
> home.dm as per the comments there - to no effect.
>

Replace (or override) the GSDL Error

macro in the Style package. It
currently looks something like the following:

GSDL Error

{
GSDL Error

}

And could be replaced by something more like:

GSDL Error

{
GSDL Error

}


> Any help,examples,links to pages explaining this/ other docs - anything
> at all useful gratefully received.
>

There's a section on macros in the Greenstone developer's guide. Get it
from http://www.greenstone.org/english/docs.html if you don't already
have it.

Hope some of this helps.

Stefan.