The comment object has the following attributes:
comment.author
Returns the author of the comment.
comment.content
Returns the content of the comment.
comment.created_at
Returns the timestamp of when the comment was submitted.
Use the date filter to convert the timestamp into a more readable format.
{{ comment.created_at | date: "%b %d, %Y" }}
Feb 26, 2017
comment.email
Returns the email address of the comment's author.
comment.id
Returns the ID (unique identifier) of the comment.
comment.status
Returns the status of the comment. Possible values:
pending: the comment is waiting for spam detection or, if the blog is moderated, for moderation.published: the comment is published and publicly visible. It passed spam detection and, if the blog is moderated, was approved.removed: the comment was removed by the shop owner.spam: the comment was marked as spam by spam detection.unapproved: the comment still needs approval by the shop owner.
Only comments with the status published are returned in article.comments.
Each blog can have its own comment moderation settings.
comment.updated_at
Returns the timestamp of when the status of the comment was last changed, for example when the article's author approved the comment.
Use the date filter to convert the timestamp into a more readable format.
comment.url
Returns the URL of the article with comment.id appended. The page then scrolls to the comment automatically.
More properties
VersaCommerce also provides these properties on the comment object:
| Properties | Returns |
|---|---|
article, blog, body, body_html, published_at, persisted? |
Parent resources, content and persistence state |