Created
June 8, 2018 10:10
-
-
Save joe-dempsey/f6476759879db381ec81b9db9c5b71db to your computer and use it in GitHub Desktop.
splitting shopify description
This file contains 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 description_parts = product.description | split: '<!-- split -->' %} | |
Amount of parts: {{ description_parts.size }} | |
Index of last part: {% assign index_last = description_parts.size | minus: 1 %} | |
First part: {{ description_parts.first }} | |
First part: {{ description_parts[0] }} | |
Second part: {{ description_parts[1] }} | |
Third part: {{ description_parts[2] }} | |
Fourth part: {{ description_parts[3] }} | |
Last part: {{ description_parts.last }} | |
Last part: {{ description_parts[index_last] }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment