[Koha-devel] TT notice question
Stephen Graham
s.graham4 at herts.ac.uk
Thu Jan 4 17:35:14 CET 2024
Sorry, I was supposed to send this to the general Koha list - please ignore!!
From: Koha-devel <koha-devel-bounces at lists.koha-community.org> On Behalf Of Stephen Graham via Koha-devel
Sent: Thursday, January 4, 2024 4:34 PM
To: koha-devel <koha-devel at lists.koha-community.org>
Subject: [Koha-devel] TT notice question
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20240104/194b3150/attachment.htm>
More information about the Koha-devel
mailing list