Template Overview
Use the {{ meerkat }} Antlers tag to render forms, comments, and thread data. The main comments tag returns more fields than the site-wide helpers.
#Tag methods
| Tag | Purpose |
|---|---|
{{ meerkat:form }} |
Render the submission form for the current thread. |
{{ meerkat:comments }} |
Return published comments for the current thread, with replies in {{ children }}. |
{{ meerkat:comment_count }} |
Number of comments on the current thread. |
{{ meerkat:comments_enabled }} |
Whether the current thread accepts submissions. |
{{ meerkat:replies_to }} |
Load the optional inline-reply script. |
{{ meerkat:recent_comments }} |
Newest comments across all threads (for sidebars). |
{{ meerkat:top_threads }} |
Most active threads. |
{{ meerkat:author_history }} |
One author's comment history. |
{{ meerkat:thread_stats }} |
Public counts or moderator-only counts for the current thread. |
{{ meerkat:success }} |
Submission feedback stored in the session. |
{{ meerkat:errors }} |
Submission errors stored in the meerkat error bag. |
{{ meerkat:debug }} |
Show which thread the tags use during local development. |
#How Meerkat finds the thread
Unless you specify a thread, Meerkat finds one from the current entry. It checks these values in order:
thread="..."parameter: if present, use it directly (either a thread ID or an entry ID).from_thread="..."parameter: alias forthread.meerkat_share_commentscontext variable: set this in an Antlers layout to share a thread across templates.- The
idcontext variable: typically the current page's entry ID. - The
pageobject: typically the current entry.
If none point to a known thread or entry, the tag returns an empty result.
{{ meerkat:comments }} and {{ meerkat:comment_count }} also accept several thread IDs separated by a pipe (thread="a|b"), or thread="*" for every thread. See Displaying comments: Querying multiple threads. The other tags accept one thread.
#Comment variables
{{ meerkat:comments }} returns stored fields, custom blueprint fields, and calculated values. Render only the fields your template needs.
{{ meerkat:recent_comments }} and {{ meerkat:author_history }} omit calculated values. recent_comments also returns the related thread entry.
#Body
id: comment IDcomment: raw text the commenter typedcomment_html: the comment text rendered through Meerkat's sanitizing Markdown renderer (safe to output unescaped)
#Author
author_name: displayed name (signed-in user's name, then the submitted guest name, then the configured anonymous name)author_email: email selected in the same orderauthor: the Statamic User ID for authenticated commenters, ornullfor guests. Available in{{ meerkat:comments }}(not inrecent_comments/author_history).name/email: compatibility aliases. Useauthor_name/author_emailin templates.gravatar: Gravatar URL derived from an MD5 hash of the selected email address.
#Threading
parent_id: ID of the parent comment, ornullfor rootsdepth: 0-based nesting depthpath: dotted hierarchy path (1.2.3style, the ancestor chain)replies_count: number of direct published repliesis_root:trueifparent_idis nullis_reply:trueif the comment has aparent_idhas_replies:trueifchildrenis non-emptyis_deleted:trueif soft-deleted. Appears only when the parent tag hasinclude_trashed="true".is_removed:truefor a moderation tombstonechildren: nested list of repliesanchor:comment-{id}permalink:#comment-{id}
#Moderation state
is_published: booleanmoderation_status:approved/pending/rejected/spamis_spam,is_ham,checked_for_spam: finer-grained spam statemoderation_reason: short string set when rejectedmoderation_notes: longer admin notesmoderated_by: actor IDmoderated_at: Carbon
Visitors cannot query unpublished, spam, or removed comments. Templates can still access moderation fields, so do not print the complete comment data in HTML or client-side JSON.
#Timestamps
created_at: Carbon, when the user submitted the commentpublished_at: Carbon, when Meerkat published the commentlast_activity_at: Carbon, activity timestamp maintained on the comment and its direct parent
#current_user block
Every comment includes a current_user.* block for the person viewing the page:
| Key | Description |
|---|---|
current_user.is_authenticated |
The viewer is signed in as a Statamic user. |
current_user.is_author |
The signed-in user is the author of this comment. |
current_user.can_edit |
Can moderate this comment's collection/site and has edit comments. |
current_user.can_delete |
Can moderate this comment's collection/site and has delete comments. |
current_user.can_reply |
The viewer may submit, reply depth allows another level, and the target entry is not explicitly or automatically closed. |
current_user.can_report_spam |
Can moderate this comment's collection/site and has report comment spam. |
For front-end edit links, check is_author and can_edit:
1{{ if current_user:is_author or current_user:can_edit }}
2 <a href="...">Edit</a>
3{{ /if }}
1@if ($current_user['is_author'] || $current_user['can_edit'])
2 <a href="...">Edit</a>
3@endif
Meerkat does not provide front-end edit or delete URLs.
#Request metadata
When enabled in meerkat.privacy, front-end submissions record:
user_ip: string (IPv4 or IPv6)user_agent: string (truncated to 1024 chars)referer: string (truncated to 1024 chars)
Do not display or return these values publicly. Anonymous API responses, recent_comments, and author_history omit them.
#Common filtering and sorting
{{ meerkat:comments }} supports Statamic conditions and sorting:
1{{ meerkat:comments is_spam:is="false" comment_text:contains="hello" order_by="created_at:asc" }}
1<s-meerkat:comments is_spam:is="false" comment_text:contains="hello" order_by="created_at:asc" />
Use field:operator="value". Supported operators are is, isnt, contains, does_not_contain, exists, doesnt_exist, in, not_in, greater_than, and less_than. See Statamic's collection filtering documentation.