Shopify themes, liquid, logos, and UX
Good morning,
I would like that when the product title is above 56 characters, the name automatically stops and adds 3 small points. (ONLY for featured collection and collections)
EXAMPLE HOW IT IS NOW:
EXAMPLE HOW I WOULD LIKE IT TO AUTOMATICALLY DO ABOVE 56 CHARACTERS IN THE TITLE:
website: jadis-shop.com
password: rj
Do you know how to do it ?
thank you very much in advance
Try something like this; let us know if you need a hand implementing:
{% assign max_length = 56 %}
{% assign product_title = product.title %}
{% if product_title.size > max_length %}
{% capture truncated_title %}{{ product_title | truncate: max_length, "" }}...{% endcapture %}
{{ truncated_title }}
{% else %}
{{ product_title }}
{% endif %}
User | RANK |
---|---|
220 | |
164 | |
65 | |
54 | |
53 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023