Comments
A container tag which iterates over a list of comments on an entry or for a blog. By default, all comments in context (meaning all the comments for that particular entry or in a blog) are returned. If you use it in a blog context, only comments on published entries are returned.
You can view a list of all comment-related template tags for an idea of the flexibility available in publishing comments. And the following attributes will let you custom-tailor the mt:Comments tag to show exactly the the comments you are selecting.
Attributes
lastn
: Display the last N comments in context where N is a positive integer. NOTE: lastn is required in a blog context.offset
(optional; default “0”): Specifies a number of comments to skip.sort_by
(optional): Specifies a sort column.sort_order
(optional): Specifies the sort order and overrides the General Settings. Recognized values are “ascend” and “descend.”namespace
: Used in conjunction with the “min” and “max” attributes to select comments based on a particular scoring mechanism.min_score
: Ifnamespace
is also specified, filters the comments based on the score within that namespace. This specifies the minimum score to consider the comment for inclusion.max_score
: Ifnamespace
is also specified, filters the comments based on the score within that namespace. This specifies the maximum score to consider the comment for inclusion.min_rank
: Ifnamespace
is also specified, filters the comments based on the rank within that namespace. This specifies the minimum rank to consider the comment for inclusion.max_rate
: Ifnamespace
is also specified, filters the comments based on the rank within that namespace. This specifies the maximum rank to consider the comment for inclusion.min_count
: Ifnamespace
is also specified, filters the comments based on the count within that namespace. This specifies the minimum count to consider the comment for inclusion.max_count
: Ifnamespace
is also specified, filters the comments based on the count within that namespace. This specifies the maximum count to consider the comment for inclusion.top
: If specified, gets a list of comments that do not contain a reply.- include_blogs
- exclude_blogs
- include_websites
- exclude_websites
Example
In an entry context, display a simple list of comments. (Note that this is a simple example: a more capable comment display is much longer; refer to the theme templates supplied with Movable Type for longer examples with complete HTML.)
<mt:Comments>
<div>
<p>A comment left by <mt:CommenterName></p>
<mt:CommentBody format="markdown">
</div>
</mt:Comments>