{{ template_collection }}

Contains a collection of templates, including pagination-related information.

Properties

string object_type
Will always be "template_collection".
true/false is_valid
Returns true if the collection contains at least one template.
list items
Contains a list of templates.
number limit
The maximum number of items that may be included in this collection.
number start
The 1-based index of the first item to be included in this collection.
number page
The 1-based index of the "page" represented by this collection - as determed by the start and limit parameters.
number total_count
The total number of templates that match the filters used to create this collection.
number total_pages
The total number of "pages" that match the filter used to create this list - as determined by the total_count and limit parameters.
html output
The default output that the template_collection would produce if it were output directly to the template - using the "output_in_list" property of each item in the list.

Use

This collection object may be evaluated as an object and as a list. When iterated through as a list, all of the standard rules for Liquid lists apply.

Example:

{% for item in collection %}
    <p>{{ forloop.index0 }}: {{ item.output_in_list }}</p>
{% endfor %}

Which is identical to

{% for item in collection.items %}
    <p>{{ forloop.index0 }}: {{ item.output_in_list }}</p>
{% endfor %}

As a shortcut, you can also output the full list using the default output values by using {{ collection }}.

Developer Overview

Liquid Markup