The comments loop is used to display the comments made in response to a blog entry.
The basic syntax of the loop is:
The loop does one iteration for each comment made in response to the blog entry.
The comments loop can also be tested like a boolean variable. It is true if there is at least one comment for the article.
Variables
Within the comments loop, you can use these variables, whose contents change with each iteration:
| A string variable containing the name of the author of the current comment.
|
| It can also be used as a boolean variable; it is true if it contains a value.
|
| If the author of the comment made the comment when logged in, author contains a value:
|
| · | If the author provided a nickname in the personal settings for his/her account, author contains that nickname.
|
| · | If the author did not provide a nickname in the personal settings for his/her account, author contains the author's username.
|
| If the author of the comment made the comment while not logged in or checked the Post anonymously checkbox, author is empty.
|
| A string variable containing the URL of the author of the current comment.
|
| It can also be used as a boolean variable; it is true if it contains a value.
|
| If the author provided an URL in the personal settings for his/her account, author_url contains that URL. If the author did not provide an URL, author_url is empty.
|
| A string variable containing the body of the comment, which the author enters into the Comment text area of the comment form.
|
| A boolean variable that is true if the reader is allowed to post a comment in reply to this article.
|
| If the publisher of the blog checks the Allow anonymous reader comments checkbox (located in the Options sidebar of the General Settings page in the Settings section), can_post is true for both logged-in and non-logged-in readers. If the publisher does not check this checkbox, can_post is true for logged-in readers and false for non-logged-in readers.
|
| An integer variable representing the "depth" of the comment.
|
| A depth of 0 means that the comment is a direct reply to the entry. A depth of 1 means that the comment is a reply to a comment that is a direct reply to the entry. A depth of 2 means that the comment is a reply to a comment which in turn is a reply to comment that is a direct reply to the entry.
|
| A string variable containing the URL for the comment.
|
| This URL is used as the "permanent link" for the comment, allowing it to be referenced with a link.
|
| A string variable containing the URL to the "comment page" for this article.
|
| The publish time for this article.
|
| The hour the comment was posted in 24-hour time.
|
| AM or PM for 12-hour time.
|
| The day the comment was posted.
|
| · | publish_time.day_name_short
|
| The abbreviated day of the week.
|
| The hour the comment was posted in 12-hour time.
|
| The minute the comment was posted.
|
| The month the comment was posted.
|
| · | publish_time.month_name_short
|
| The abbreviated name of the month.
|
| The second the comment was posted.
|
| The year the comment was posted.
|
| The time zone being used to calculate times.
|
| A string variable containing the title of the comment, which the author enters into the Subject text box of the comment form.
|
Example
| <a name="{{marker}}"></a>
|
| <div class="commentIndent{{depth}}">
|
| <div class="commentTitle">{{title}}</div>
|
| <div class="commentAuthor">by
|
| <a href="{{author_url}}">{{author}}</a>
|
| at {{publish_time.hour}}:{{publish_time.min}}{{publish_time.ampm}} ({{publish_time.zone}}) on {{publish_time.month_name_short}} {{publish_time.day}}, {{publish_time.year}} | <a href="#{{marker}}">Permanent Link</a></div>
|
| <div class="commentBody">{{body}}</div>
|
| <div class="commentReply"><a href="{{post_reply_url}}">Reply</a></div>
|
| </div> <!-- commentIndentn -->
|
| {{/if}} <!-- comments -->
|
Trackbacks
TrackBack URL:
http://demo.blogharbor.com/blog/_trackback/82631
No trackbacks found.