<$mt:EntryCommentCount$>

Outputs the number of published comments for the current entry in context.

Attributes

All <mt:EntryCommentCount> attributes are optional. The most common attributes are:

singular

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

<$mt:EntryCommentCount singular="1 comment">

plural

Allows special formatting for when the number of published comments for the entry is greater than 1.

<$mt:EntryCommentCount plural="# comments">

none

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

<$mt:EntryCommentCount none="No comments">

or

<$mt:EntryCommentCount none="None">

Example

<$mt:EntryCommentCount singular="1 comment" plural="# comments" none="no comments"$>
This page was last updated on 2010-06-18, 13:15.

4 Notes

From one of the default templates, I picked up this nugget:

      " plural="" none=""$>

I guess this means that this tag takes additional attributes:

  • singular
  • plural
  • none

to be used thus

              singular="Comment" plural="Comments" none="No Comments"

The tag then evaluates the number and if it is 0, uses the none attribute; if 1, then the singular attribute, and if more than 1, the plural attribute.

correction:

it's this:

           singular="1 comment" plural="# comments" none="No comments"

And it works on all count tags.

Awesome. Thanks, Gautam Patel.

We're recognizing Gautam's observation by adding it to the documentation. Thanks.

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.