[Koha] TT Notice question

Stephen Graham s.graham4 at herts.ac.uk
Fri Jan 5 05:35:45 NZDT 2024


Hi All - not specifically Koha I guess, but maybe someone can explain why this happens. I had some TT in an email notice like:

[% IF illrequests.branchcode ==  "CL" %]
College Lane LRC
[% ELSIF illrequests.branchcode == "DH" %]
De Havilland LRC
[% ELSE %]
<<illrequests.branchcode>>
[% END %]

Every time I generated the email it printed CL, which is the value of llrequests.branchcode. I just could not get the first condition to work no matter what I did - it never printed College Lane LRC always CL. However, I changed it to:

[% SET localbranch = illrequests.branchcode %]

[% IF illrequests.branchcode ==  localbranch %]
College Lane LRC
[% ELSIF illrequests.branchcode == localbranch %]
De Havilland LRC
[% ELSE %]
<<illrequests.branchcode>>
[% END %]

, and this works if I set the illrequests.branchcode to a local variable and then check this.

Not sure why I have to do this? The example I have seen on the wiki look like I should be able to test a variable against a string using ==. Just couldn't get it to work. Any ideas?

Stephen


--------------------------------------
Stephen Graham
Library Technology Consultant
Library and Computing Services

University of Hertfordshire
Hatfield, Hertfordshire, AL10 9AB

Email: s.graham4 at herts.ac.uk<mailto:s.graham4 at herts.ac.uk>
Website: herts.ac.uk



More information about the Koha mailing list