DOCS

Count all mod

Some fields can contain multiple rows of information, for example Taxonomies, Repeater fields, Recurring date fields, Gallery fields, File fields etc. We refer to these as Loopable fields.

The Count All mod outputs the number of rows or items a loopable field contains

Examples

In some cases, the number of may be useful for display purposes, for example to create a sentence such as:

This post has 3 categories.

using dynamic tags, this sentence is created by applying a count mod to one of the category dynamic tags such as Term name

This post has @post(category.name).count() categories

In other cases, the count may be useful as visibility rule. For example, if you are using a Gallery widget to display a Gallery field, but the number of images uploaded is one, then in that case you might hide the Gallery widget based on item count, and instead display a plain Image widget.

In that case the visibility rule to hide the gallery when the number of images is 1 would be

Hide if > dynamic tag > @post(gallery.id).count() > is equal to 1

Continue reading