
The following template sample will display the comment form, using CAPTCHA. The comment settings need to be enabled for article and article type, as explained further up in this manual.
{{ if $campsite->article->comments_enabled }}
<div id="comments">
<a name="comments">
<h3>Comments</h3>
</a>
{{ list_article_comments }}
{{ if $campsite->current_list->at_beginning }}
<a name="commentlist">
<h4>Previous comments</h4>
</a>
{{ /if }}
<div class="comment" {{ if $campsite->current_list->at_end }}id="everlast"{{ /if }}>
<p><strong>{{ $campsite->comment->subject }}</strong></p>
<p>{{ $campsite->comment->content }}</p>
<p><em>{{ $campsite->comment->nickname }} | <span>{{ $campsite->comment->submit_date|camp_date_format:"%M %e, %Y" }}</span></em></p>
</div><!-- /.comment -->
{{ /list_article_comments }}
<a name="commentform">
<h4>Post a comment</h4>
</a>
{{ if $campsite->submit_comment_action->rejected }}
<div class="posterror">Your comment has not been accepted.</div>
{{ /if }}
{{ if $campsite->submit_comment_action->is_error }}
<div class="posterror">{{ $campsite->submit_comment_action->error_message }}
<span class="posterrorcode">{{ $campsite->submit_comment_action->error_code }}</span>
</div>
{{ else }}
{{ if $campsite->submit_comment_action->defined }}
{{ if $campsite->publication->moderated_comments }}
<div class="postinformation">Your comments has been passed on to the editors for approval.</div>
{{ /if }}
{{ /if }}
{{ /if }}
{{* if $campsite->comment->defined }}
<p><strong>{{ $campsite->comment->subject }}
({{ $campsite->comment->reader_email|obfuscate_email }}) -
{{ $campsite->comment->level }}</strong></p>
<p>{{ $campsite->comment->content }}</p>
{{ /if *}}
{{ if $campsite->user->blocked_from_comments }}
<div class="posterror">The user you are logged in as, has been blocked from writing comments.</div>
{{ else }}
{{ comment_form submit_button="Send comment" }}
<div class="form-element">
<label for="CommentSubject">Name:</label>{{ camp_edit object="comment" attribute="nickname" }}
</div>
<div class="form-element">
<label for="CommentEmail">Email (required):</label>{{ camp_edit object="comment" attribute="reader_email" }}
</div>
<div class="form-element">
<label for="CommentNickname">Subject (required):</label>{{ camp_edit object="comment" attribute="subject" }}
</div>
<div class="form-element">
<label for="CommentContent">Comment:</label>{{ camp_edit object="comment" attribute="content" }}
</div>
{{ if $campsite->publication->captcha_enabled }}
<div class="form-element clearfix">
<label for="submitComment">SPAM-protection:</label>
<img src="../{{ captcha_image_link }}"><br clear="all" />
<label for="f_captcha_code">Type letters here: </label>{{ camp_edit object="captcha" attribute="code" }}
</div>
{{ /if }}
<div class="form-element">
<label for="submitComment"></label>
</div>
{{ /comment_form }}
{{ /if }}
{{ unset_comment }}
{{ if $campsite->comment->defined }}
<div class="posterror">Error: Your recent comment is still being processed.<div>
{{ /if }}
</div><!-- /#comments -->
{{ /if }}