Re: [greenstone-devel] {If} in format statements

From Stephen.DeGabrielle@ntu.edu.au
DateFri, 9 May 2003 15:04:53 +0930
Subject Re: [greenstone-devel] {If} in format statements

Thanks John,

I've tried that with this line

format DocumentText '<center><table width=537><tr><td align=left><br/>{If}{"[rights]" eq "A",IP RIGHTS STATEMENT A[rights],[rights]IP RIGHTS STATEMENT B} </td></tr></table></center>'

but it is still failing to evaluate to false when I need it to.

I have seen  -- {If}{"[Volume][Number]",<tr><td colspan="2">} -- in the 'format DocumentHeading' statement in the colt bibliography but I am not sure what is going on here.

(there is a second {If} statement in the 'format DocumentHeading' that closes the the row and cell)

 

Once again I appeal to list members for help and/or suggestions. Any ideas on this is appreciated.

Thanks

Stephen

 

 

Stephen.DeGabrielle@ntu.edu.au wrote:

> format DocumentText "<center><table width=537><tr><td align=left><br/>{If}
> {[rights] eq A,IP RIGHTS STATEMENT 'A',IP RIGHTS STATEMENT 'B'}
> </td></tr></table></center>"
>
> I am trying to do a comparison but for some reason cannot get it to return
> anything but IP RIGHTS STATEMENT 'A' Is someone able to provide some advice
> on using the {If} statement with 'eq', 'ne' and other operators on metadata
> fields?     (My [rights] metadata for each record is either A or B)

That looks like it should work... perhaps you need quotes around the
term(s) in the eq test? Otherwise it might be trying to do integer
comparison rather than string comparison.

> Another situation is to have  both A and B in my [rights] metadata field;
> Has anyone solved this problem?

Don't know about this situation, sorry. Maybe someone else can
help with multiple values.

John