Comments
Stars provides a threaded comment system on entries, with the same four-state moderation, spam protection, and login-gating as reviews. Enable it under Stars → Settings (enableComments).
Comment Form
Post comments to the stars/comments/save action. To create a reply, include the parent comment’s parentId. Name and email fields are used for guests only — logged-in users are filled in automatically.
<form method="post">
{{ csrfInput() }}
{{ actionInput('stars/comments/save') }}
{{ redirectInput('') }}
<input type="hidden" name="entryId" value="{{ entry.id }}">
{# For a reply, include the parent comment's id: #}
{# <input type="hidden" name="parentId" value="{{ parentComment.id }}"> #}
<input type="hidden" name="__stars_ts" value="{{ now|date('U') }}">
<div style="position:absolute;left:-9999px" aria-hidden="true">
<input type="text" name="starsHoneypot" tabindex="-1" autocomplete="off">
</div>
{# Name/email are only used for guests; logged-in users are filled in automatically. #}
<label for="authorName">Name</label>
<input type="text" id="authorName" name="authorName">
<label for="body">Comment</label>
<textarea id="body" name="body" required></textarea>
<button type="submit">Post Comment</button>
</form>
Displaying Comments
The simplest way to render a full nested thread is the bundled recursive macro, fed by craft.comments.tree(entry):
{% import 'stars/_comments/thread' as commentThread %}
{{ commentThread.thread(craft.comments.tree(entry)) }}
Or build the markup yourself — each comment in the tree exposes its replies via .children:
{% for comment in craft.comments.tree(entry) %}
<article class="comment">
<strong>{{ comment.authorName }}</strong>
<p>{{ comment.body }}</p>
{% for reply in comment.children %}
<article class="comment comment--reply">
<strong>{{ reply.authorName }}</strong>
<p>{{ reply.body }}</p>
</article>
{% endfor %}
</article>
{% endfor %}
Reply nesting is capped by the Max Comment Depth setting (maxCommentDepth); deeper replies are automatically attached at the deepest allowed level.
Captcha
craft.comments.captcha() returns the active captcha provider and site key (or null when captcha is off), mirroring the reviews API, so the same widget works for both forms.
craft.comments API Reference
| Method | Returns | Description |
|---|---|---|
tree(entry) | Comment[] | Approved comments as a nested tree (replies on .children) |
forEntry(entry) | CommentQuery | Approved comments for an entry, oldest first |
topLevel(entry) | CommentQuery | Approved top-level comments (no replies) |
replies(comment) | array | Approved replies to a comment |
count(entry) | int | Count of approved comments |
captcha() | array|null | Active captcha provider and site key |