Vor Kurzem aufgerufene Suchen


Keine vor kurzem aufgerufene Suchen

Using Placeholder Text for to reduce to Initials



Gepostet 05. Nov. 2022

Hello!

Is there a way to reduce a placeholder from a full string to a partial string?  I have a use case where I'd need to reduce a full name into the first three letters of the first and last name.

Ex: John Smith -> JOH SMI

I have the first and last name of the requester available as placeholders but they are the full name.  Does anyone have creative ideas for how to reduce to just the first three digits?  Sort of like the left() function in excel?

Thanks!


0

1

1 Kommentar

Hi Caitlin

You can use something like 

{{ticket.requester.first_name | slice: 0,3}} {{ticket.requester.last_name| slice: 0,3}}

To get only the first three symbols of both parts.

And all in uppercase:

{{ticket.requester.first_name | slice: 0,3 | upcase}} {{ticket.requester.last_name | slice: 0,3 | upcase}}

Sources:

https://shopify.github.io/liquid/filters/slice/

https://shopify.github.io/liquid/filters/upcase/

0


Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Sie finden nicht, wonach Sie suchen?

Neuer Post