Class: Archangel::Liquid::Tags::CollectionforTag

Inherits:
Liquid::For
  • Object
show all
Defined in:
lib/archangel/liquid/tags/collectionfor_tag.rb

Overview

Collection custom tag for Liquid to set a variable for Collections

Example

{% collectionfor item in 'my-collection' %}
  {{ forloop.index }}: {{ item.name }}
{% endcollectionfor %}

{% collectionfor item in 'my-collection' limit:5 offset:25 %}
  {{ forloop.index }}: {{ item.name }}
{% endcollectionfor %}

{% collectionfor item in 'my-collection' reversed %}
  {{ forloop.index }}: {{ item.name }}
{% endcollectionfor %}

{% collectionfor item in 'my-collection' %}
  {{ forloop.index }}: {{ item.name }}
{% else %}
   There is nothing in the collection.
{% endcollectionfor %}

{% collectionfor item in 'my-collection' %}
  {{ forloop.name }}
  {{ forloop.length }}
  {{ forloop.index }}
  {{ forloop.index0 }}
  {{ forloop.rindex }}
  {{ forloop.rindex0 }}
  {{ forloop.first }}
  {{ forloop.last }}
  {{ forloop.parentloop }}
{% endcollectionfor %}