Created
February 18, 2013 19:42
-
-
Save bobdenotter/4980044 to your computer and use it in GitHub Desktop.
Bolt: When looping over an array to create a list, give the <li> classes like 'first', 'last', 'odd' and 'even'.
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
<ul> | |
{% for record in records %} | |
<li class="{% if loop.first %}first {% endif %}{% if loop.last %}last {% endif %} {{ cycle(["even", "odd"], loop.index) }}"> | |
<a href="{{ record.link }}">{{ record.title }}</a> | |
</li> | |
{% endfor %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment