Collections

Allows you to choose one or more collections.

Learn by watching!
Check out the fundamentals screencast on Collections.

Preview

Collections Fieldtype

Usage

This fieldtype is used to view and select from a list of Collections.

fields:
  my_collections_field:
    type: collections

Data Structure

The Collections fieldtype is a Relate fieldtype, and will save the collections as their handles (the folder name).

listings:
  - blog
  - things

Templating

You’re more than likely using this field as a way to dynamically display a collection.

Since the collection tag accepts a pipe-delimited list of collection names, you can join them together like this:

<ul>
  {{ collection from="{listings|piped}" }}
    <li>{{ title }}</li>
  {{ /collection }}
</ul>
<ul>
  <li>A blog entry</li>
  <li>A thing entry</li>
  <li>etc</li>
</ul>

Settings

This fieldtype supports the following settings in addition to the settings available in the Relate fieldtype.

collection

string/array

You can pass a single collection as a string or multiple collections as an array.

Last modified on March 20, 2018