Created
February 13, 2014 02:02
-
-
Save dominikwilkowski/8968404 to your computer and use it in GitHub Desktop.
This snippet displays "is-first" or "is-last" within a loop for class names
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
{% comment %} | |
This snippet displays "is-first" or "is-last" within a loop for class names | |
Usage: | |
{% for p in collection.products %} | |
<li class="{% include 'for-looper' %}"> ... </li> | |
{% endfor %} | |
Return: | |
no return | |
Required: | |
Needs to be called within a for loop | |
{% endcomment %} | |
{% if forloop.first %}first{% endif %} {% if forloop.last %}last{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment