Not a developer? Go to MovableType.com

Documentation

EntriesCount

Returns the count of a list of entries that are currently in context (ie: used in an archive template, or inside an Entries tag). If no entry list context exists, it will fallback to the list that would be selected for a generic Entries tag (respecting number of days or entries configured to publish on the blog’s main index template).

How is this tag different from the BlogEntryCount tag? The BlogEntryCount tag will only return a count of all published entries. The EntriesCount tag can also do that, but it can also display a subset. Examples below.

Attributes

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:EntriesCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:EntriesCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:EntriesCount none="No entries">

or

<mt:EntriesCount none="None">

Example

This returns

"1 entry" or "9 entries" or "No entry".

Compared to BlogEntryCount

By itself, these two tags return the same count:

<mt:EntriesCount>
<mt:BlogEntryCount>

However, within the Entry context, Entries count can return a subset value:

<mt:Entries category="News">
    <mt:EntriesCount>
</mt:Entries>

Note that only the Entry context can be used with EntriesCount to find subset values; other contexts (such as Author or Monthly) will not find subset values.

Back