Object: collections
Variables
.all
List of all active collections.
Examples
CODE{% for collection in collections.all %}
{{ collection.name }}<br/>
{% endfor %}
OUTPUTNotebooks
Tablets
...
.by_ref
Access a collection by its reference name.
Examples
CODEcollections.by_ref.notebooks.name
OUTPUTNotebooks
.by_tag
Access a set of collections sharing a tag.
Examples
CODE{% for collection in collections.by_tag.primary %}
{{ collection.name }}<br/>
{% endfor %}
OUTPUTComputers
Photography
...
Variable Dump
Copy and paste the below HTML into any template page, to see all collection data dumped to your 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">All Collections</div> <div class="code"><pre>{% for collection in collections.all %} <p> id: {{ collection.id }}<br/> reference: {{ collection.ref }}<br/> name: {{ collection.name }} url: {{ collection | collection_url }} link: {{ collection | collection_link: collection.name }} </p> {% endfor %}</pre></div> <div class="out"> {% for collection in collections.all %} <p> id: {{ collection.id }}<br/> reference: {{ collection.ref }}<br/> name: {{ collection.name }}<br/> url: {{ collection | collection_url }}<br/> link: {{ collection | collection_link: collection.name }} </p> {% endfor %} </div> <div class="name">Collection By Reference</div> <div class="code"><pre>{{ collections.by_ref.notebooks.name }}</div> <div class="out">{{ collections.by_ref.notebooks.name }}</div> <div class="name">Collections By Tag</div> <div class="code"><pre>{% for collection in collections.by_tag.primary %} <p> id: {{ collection.id }}<br/> reference: {{ collection.ref }}<br/> name: {{ collection.name }} url: {{ collection | collection_url }} link: {{ collection | collection_link: collection.name }} </p> {% endfor %}</pre></div> <div class="out"> {% for collection in collections.by_tag.primary %} <p> id: {{ collection.id }}<br/> reference: {{ collection.ref }}<br/> name: {{ collection.name }}<br/> url: {{ collection | collection_url }}<br/> link: {{ collection | collection_link: collection.name }} </p> {% endfor %} </div> </div>