Created
November 29, 2017 08:08
-
-
Save andreibabor/6889ff3f4ea0f27638c885a9f6910dc9 to your computer and use it in GitHub Desktop.
Shopify extract first word from a string = collection.handle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign my_subcollection = collection.handle %} | |
{% assign stringSplit = my_subcollection | split:'-' %} | |
{% for stringPart in stringSplit %} | |
{%if forloop.first == true %} | |
<span>{{ stringPart | strip }}</span> | |
{%endif%} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment