Skip to content

Instantly share code, notes, and snippets.

@andershaig
Created June 12, 2013 16:00
Show Gist options
  • Select an option

  • Save andershaig/5766681 to your computer and use it in GitHub Desktop.

Select an option

Save andershaig/5766681 to your computer and use it in GitHub Desktop.
Single category at a time
<!-- Current Code on lines 30-32 -->
{% for category in gallery_settings.categories %}
<a href="#" data-cat="{{ category.title | handelize }}"><li>{{ category.title }}</li></a>
{% endfor %}
<!-- First category only -->
{% for category in gallery_settings.categories limit:1 %}
<a href="#" data-cat="{{ category.title | handelize }}"><li>{{ category.title }}</li></a>
{% endfor %}
<!-- Second category only -->
{% for category in gallery_settings.categories limit:1 offset:1 %}
<a href="#" data-cat="{{ category.title | handelize }}"><li>{{ category.title }}</li></a>
{% endfor %}
<!-- So if you have categories called '1' and '2', this code would output '2' then '1' instead -->
{% for category in gallery_settings.categories limit:1 offset:1 %}
<a href="#" data-cat="{{ category.title | handelize }}"><li>{{ category.title }}</li></a>
{% endfor %}
{% for category in gallery_settings.categories limit:1 %}
<a href="#" data-cat="{{ category.title | handelize }}"><li>{{ category.title }}</li></a>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment