# Collections

## Usage

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

```yaml
fields:
  my_collections_field:
    type: collections
```

## Data Structure

The Collections fieldtype is a [Relationship fieldtype](/relationships.md#fieldtypes), and will save the collections as their handles (the folder name).

```yaml
listings:
  - blog
  - things
```

## Templating

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

::tabs

::tab antlers

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

```antlers
<ul>
  {{ collection from="{listings|piped}" }}
    <li>{{ title }}</li>
  {{ /collection }}
</ul>
```

::tab blade

You can pass the values from the collections fieldtype to the collection tag like so:

```blade
<ul>
	<statamic:collection
		:from="$listings ?? []"
	>
		<li>{{ $title }}</li>
	</statamic:collection>
</ul>

```

::

```html
<ul>
  <li>A blog entry</li>
  <li>A thing entry</li>
  <li>etc</li>
</ul>
```
