Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

For a software dev like me who has no idea how to create a cute hand-drawn dashed line, this course just 100% works.

— Ira Zayats, Developer

Collection:Count Tag

This tag is a clone of the collection tag but with one big difference: it only returns the total number of entries that match your set of filters.

Overview

This tag's only purpose is to fetch the number of the entries in a collection that match your set of filtering parameters without the need for a tag pair/loop.

Example

There are {{ collection:count in="pogs" }} pogs in this site.
There are 6201 pogs in this site.

You could do the same thing inside a regular collection tag by aliasing the results to a single variable and using the count modifier.

{{ collection:blog as="entries" }}
There are {{ entries | count }} pogs in this site.
{{ /collection:blog }}

Parameters

in|from

string

The collection in which to count entries.

*

inherit

All parameters available on the collection tag are available.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →
Hello there! Are you looking for the Statamic v2 documentation?