Variables

.id

Unique ID of the collection. Collection IDs are generated automatically at the time of creating the collection and cannot be changed.

TYPE
numeric
CONSTRAINTS
>= 1
PRESENCE
always

Examples

CODE{{ collection.id }}
OUTPUT1123

CODE{{ collection.id | collection_url }}
OUTPUT/collection/notebooks
NB: the exact URL depends on the Collection URL configuration.

CODE{{ collection.id | collection_link: 'see all notebooks' }}
OUTPUT<a href="/collection/notebooks">see all notebooks</a>
NB: the exact URL depends on the Collection URL configuration

.ref

Unique reference name of the collection, based on configuration under Collection » Update » Reference name.

TYPE
reference
CONSTRAINTS
alphanumeric, dashes and underscores
PRESENCE
always

Examples

CODE{{ collection.ref }}
OUTPUTnotebooks

URLs

Do not use .ref to construct a collection URL manually. Use the collection_url filter instead, on either the .id, .ref or the collection object itself.

.name

Display name of the collection as configured under Collection » Update » Name.

TYPE
string
CONSTRAINTS
none
PRESENCE
always

Examples

CODE{{ collection.name }}
OUTPUTNotebooks

.products

List of products within the collection.

TYPE
array of objects
CONSTRAINTS
n/a
PRESENCE
always, but could be zero-length

Examples

CODE{% for product in collection.products %}
  {{ product.name }} @ {{ product.price | money }}<br/>
{% endfor %}
OUTPUTSony Vaio 13" Notebooks @ USD 999.95
Sony Vaio 15" Notebooks @ USD 799.95
...

Variable Dump

Copy and paste the below HTML into a collection type template page, to see all collection data dumped to your collection page. You can then simply remove the unnecessary fields and other elements, and format the remaining fields however necessary to achieve the desired look and feel.

<style>
.thedump .name{
	background-color:#3A5FCD;
    color:white;
    padding:0.5em;
    font-weight:bold;
}
.thedump .code{
    background-color:#888888;
    color:white;
    padding:0.5em;
}
.thedump .out{
    background-color:white;
    color:#555555;
    padding:0.5em;
    border-bottom:1px solid #CCCCCC;
    margin-bottom:1em;
}
.thedump .code pre{
    padding:0;
    margin:0;
    font-size:1.1em;
}
</style>

<div class="thedump">
    <div class="name">Collection ID</div>
    <div class="code"><pre>&#123;&#123; collection.id &#125;&#125;</pre></div>
    <div class="out">{{ collection.id }}</div>
    
    <div class="name">Collection URL</div>
    <div class="code"><pre>&#123;&#123; collection | collection_url &#125;&#125;</pre></div>
    <div class="out">{{ collection | collection_url }}</div>
    
    <div class="name">Collection Reference</div>
    <div class="code"><pre>&#123;&#123; collection.ref &#125;&#125;</pre></div>
    <div class="out">{{ collection.ref }}</div>
    
    <div class="name">Collection Name</div>
    <div class="code"><pre>&#123;&#123; collection.name &#125;&#125;</pre></div>
    <div class="out">{{ collection.name }}</div>
    
    <div class="name">Collection Featured Image</div>
    <div class="code"><pre>id: &#123;&#123; collection.featured_image.id &#125;&#125;&lt;br/&gt;
alt: &#123;&#123; collection.featured_image.alt &#125;&#125;&lt;br/&gt;
notes: &#123;&#123; collection.featured_image.notes &#125;&#125;&lt;br/&gt;
&#123;&#123; collection.featured_image.src &#125;&#125;&lt;br/&gt;
&#123;&#123; collection.featured_image.src | img_tag &#125;&#125;&lt;br/&gt;
&#123;&#37; for variant in collection.featured_image.variants &#37;&#125;
    &#123;&#123; variant.ref &#125;&#125;&lt;br/&gt;
    &#123;&#123; variant.src &#125;&#125;&lt;br/&gt;
    &#123;&#123; variant.src | img_tag &#125;&#125;&lt;br/&gt;
&#123;&#37; endfor &#37;&#125;
&#123;&#123; collection.featured_image.variants.small.src &#125;&#125;&lt;br/&gt;
&#123;&#123; collection.featured_image.variants.small.src | img_tag &#125;&#125;&lt;br/&gt;</pre></div>
    <div class="out">
        id: {{ collection.featured_image.id }}<br/>
        alt: {{ collection.featured_image.alt }}<br/>
        notes: {{ collection.featured_image.notes }}<br/>
        {{ collection.featured_image.src }}<br/>
        {{ collection.featured_image.src | img_tag }}<br/>
        {% for variant in collection.featured_image.variants %}
            {{ variant.ref }}<br/>
            {{ variant.src }}<br/>
            {{ variant.src | img_tag }}<br/>
        {% endfor %}
        {{ collection.featured_image.variants.small.src }}<br/>
        {{ collection.featured_image.variants.small.src | img_tag }}<br/>
    </div>
    
	<div class="name">Products</div>
    <div class="code"><pre>&#123;&#37; for product in collection.products &#37;&#125;
    &lt;p&gt;
    id: &#123;&#123; product.id &#125;&#125;&lt;br/&gt;
    reference: &#123;&#123; product.ref &#125;&#125;&lt;br/&gt;
    name: &#123;&#123; product.name &#125;&#125;
    url: &#123;&#123; product | product_url &#125;&#125;
    link: &#123;&#123; product | product_link: product.name &#125;&#125;
    &lt;/p&gt;
&#123;&#37; endfor &#37;&#125;</pre></div>
    <div class="out">
		{% for product in collection.products %}
		<p>
        	id: {{ product.id }}<br/>
	        reference: {{ product.ref }}<br/>
    	    name: {{ product.name }}<br/>
    	    url: {{ product | product_url }}<br/>
    	    link: {{ product | product_link: product.name }}
		</p>
        {% endfor %}
    </div>
</div>