[Evergreen-general] Conditional Statement in Receipt Template

Terran McCanna tmccanna at georgialibraries.org
Wed Nov 20 15:35:40 EST 2024


We do it using ternary logic:

{{patron.pref_first_given_name ? patron.pref_first_given_name :
patron.first_given_name}}

If preferred first name exists, then use preferred first name - otherwise
use first given name.

On Wed, Nov 20, 2024 at 3:28 PM Chauncey Montgomery via Evergreen-general <
evergreen-general at list.evergreen-ils.org> wrote:

> We are trying to create a conditional statement within the receipt
> templates that will display a user's preferred name, if that condition is
> true; otherwise, the given name will be displayed on the receipt.
>
> How would I go about creating a conditional statement that checks if there
> is a value in the patron.pref_first_given_name field?
>
> Many thanks.
> CM
> --
> Chauncey Montgomery
> Community Library
> 44 Burrer Dr | Sunbury, OH 43074
> 740-965-3901 | https://www.yourcl.org
> _______________________________________________
> Evergreen-general mailing list
> 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/20241120/8a05b17c/attachment.htm>


More information about the Evergreen-general mailing list