Recent searches


No recent searches

Using Placeholder Text for to reduce to Initials



Posted Nov 05, 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 comment

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


Please sign in to leave a comment.

Didn't find what you're looking for?

New post