[Evergreen-general] One more receipt template question w/ a scoop of gratitude

Garry Collum gcollum at hotmail.com
Fri Jul 29 13:55:52 EDT 2022


Ternary operators do work in print templates, so if the variables are available in the template, you could do something like this.

{staff.pref_family_name ? staff.pref_family_name : staff.family_name}


This will print staff.family_name if staff.pref_family_name is not available.

________________________________
From: Evergreen-general <evergreen-general-bounces at list.evergreen-ils.org> on behalf of Terran McCanna via Evergreen-general <evergreen-general at list.evergreen-ils.org>
Sent: Friday, July 29, 2022 1:21 PM
To: Evergreen Discussion Group <evergreen-general at list.evergreen-ils.org>
Cc: Terran McCanna <tmccanna at georgialibraries.org>
Subject: Re: [Evergreen-general] One more receipt template question w/ a scoop of gratitude

You could try using staff.pref_first_given_name and staff.pref_family_name but I haven't actually tested to confirm they are available to a receipt. If they aren't, then it would require a bit of development to flesh out that data.

If they ARE available, you could do IF conditions as such:

[image.png]
(pasting screenshot since I suspect code snippets won't display in an email properly)

I can't remember off the top of my head if you can use ternary operators in print templates, but that would be more concise.



[https://lh6.googleusercontent.com/fJoF6o0xl9XByQZmykva1sv2n_cKGUXL_BH4crkpJgSqDu-yU7-5jIypuXBsEuoXCCBAAUQ2jUztJlZDNUVOlwl1bWZIL1W4wmFuEEzCLVMxUyhzdkV7jkcRcdZZni2z8OPz4xJA]

Terran McCanna, PINES Program Manager

________________________________

Georgia Public Library Service | University System of Georgia

2872 Woodcock Blvd, Suite 250 l Atlanta, GA 30341

(404) 235-7138 | tmccanna at georgialibraries.org<mailto:tmccanna at georgialibraries.org>

http://help.georgialibraries.org | help at georgialibraries.org<mailto:help at georgialibraries.org>


[https://lh4.googleusercontent.com/77DYzuoZ-zqC0pyQuYNKCrWaPuOANHsYTJze0JxE_iK4yW2sCswywdPCC8hCHOIyhO7KKIO-L6dlN1wIqdHFcyJmTa1fuc5Ok34dR8FQTtZHawpgNmovGxjg9RS0-WI74dFDHw0_]<https://www.facebook.com/georgialibraries>[https://lh4.googleusercontent.com/1bKX66xWgHe-v5FD5l-hYX4FrZDXi1Y2aKr0DZLDA_oEHy7s01WVqgVilQcwGBzRQZAg3yOePmZncGwtiYGSgavOkb0T5Tj3c46iUJ7ZE7h-MUEhVwXQs7Oc3cahIYMN2SGlk_6b]<https://www.twitter.com/georgialibs>[https://lh3.googleusercontent.com/U7PH5YIQnuRvbeMnGOlJAEPAre7Zqx_I6IDJAtJVwUDCp1-TmjSwP_x21qKx8ApsbcaILIuSpL3Pzau2Rz-phR_4IPcLR4LrIha_JMDHqombNtsfa1uhXcYS02QWTAyYqSf3ES_n]<https://www.instagram.com/georgialibraries/><https://www.twitter.com/georgialibs>

Join our email list<http://georgialibraries.org> for stories of Georgia libraries making an impact in our communities.



On Fri, Jul 29, 2022 at 10:32 AM Frasur, Ruth via Evergreen-general <evergreen-general at list.evergreen-ils.org<mailto:evergreen-general at list.evergreen-ils.org>> wrote:

Hello all,



I come to you again asking for your knowledge.  Thank you to everyone who provided code snippets and links to code snippets for adding “You saved…” information to receipt templates.  Another request has come through that is a little more complex.  An EI member library is asking about any way to conditionally include, in a receipt template, a preferred staff (user) name if it exists in lieu of the “proper” staff name.



Ruth Frasur (she/they)

Coordinator

Evergreen Indiana Library Consortium

Evergreen Community Development Initiative

Indiana State Library

140 N. Senate Ave.

Indianapolis, IN 46204

(317) 232-3691



_______________________________________________
Evergreen-general mailing list
Evergreen-general at list.evergreen-ils.org<mailto:Evergreen-general at list.evergreen-ils.org>
http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20220729/1836553f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 4710 bytes
Desc: image.png
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20220729/1836553f/attachment-0001.png>


More information about the Evergreen-general mailing list