Skip to content

Instantly share code, notes, and snippets.

@bobdenotter
Created May 14, 2013 19:51
Show Gist options
  • Save bobdenotter/5578943 to your computer and use it in GitHub Desktop.
Save bobdenotter/5578943 to your computer and use it in GitHub Desktop.
Using a loop, with loop.first to make the first one different..
{# get some records.. #}
{% setcontent records = "pages/latest/6" %}
{# use for to iterate over the records. #}
{% for record in records %}
{% if loop.first %}
{# first record is bigger.. #}
<article class="big">
<h1><a href="{{ record.link }}">{{ record.title }}</a></h1>
{{ record.introduction }}
</article>
{% else %}
<article class="other">
<h2><a href="{{ record.link }}">{{ record.title }}</a></h2>
{{ record.introduction }}
</article>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment