I’m building out the blog section of a site, and I figure out why the comments form is not displaying. You can view the live page here: http://www.aerometric.com/insight/lidar-presentation/.
- “insight” is the name of the weblog, and it is setup to allow entries.
- Lidar Presentation is an entry
- The “insight” weblog is setup to allow comments (in weblog administration > channel preferences)
- I added the
url_title="{segment_2}" because of a previous forum post I saw. I thought this would help, but it didn’t.
- The comment form code IS NOT nested inside of any
{exp:weblog:entries}{exp:comment:entries}tags.
- The documentation says the “preview” variable is required, but I don’t want to show any previews. Is there a way to not allow previewing of the comment, and to just post it when the user clicks “submit”?
Here is the code I’m using to try & display the comments form:
<div id="comment-form">
{exp:comment:form weblog="insight" preview="insight/details" url_title="{segment_2}"}
<h3>Add Your Comment</h3>
<p> {if logged_out}<br />
<div class="comment_label"><br />
Name:<br />
</div></p>
<p> <div class="comment_field"><br />
<input type="text" class="textbox" name="name" value="{name}" /><br />
</div><br />
<br />
<div class="comment_label"><br />
Email:<br />
</div></p>
<p> <div class="comment_field"><br />
<input type="text" class="textbox" name="email" value="{email}" /><br />
</div></p>
<p> <div class="comment_label"><br />
URL:<br />
</div><br />
<br />
<div class="comment_field"><br />
<input type="text" class="textbox" name="url" value="{url}" /><br />
</div><br />
{/if}<br />
<br />
<div class="comment_label"><br />
Comments:<br />
</div></p>
<p> <div class="comment_field"><br />
<textarea name="comment" cols="60" rows="12">{comment}</textarea><br />
</div></p>
<p> {if logged_out}<br />
<div class="comment_field"><br />
<br />
<input type="checkbox" class="check" name="save_info" value="yes" {save_info} /> <br />
Remember me?<br />
<br />
</div><br />
{/if}</p>
<p> <div class="comment_field"><br />
<br />
<input type="checkbox" class="check" name="notify_me" value="yes" {notify_me} /> <br />
Shoot me an email when someone responds?<br />
<br />
</div></p>
<p> {if captcha}<br />
<div class="comment_label"><br />
Enter this word:<br />
</div><br />
<div class="comment_field"><br />
{captcha}<br />
</div><br />
<div class="comment_label"><br />
Here:<br />
</div><br />
<div class="comment_field"><br />
<br />
<input type="text" class="textbox" name="captcha" value="" <br />
size="20" maxlength="20" style="width:140px;" /><br />
<br />
</div><br />
{/if}</p>
<p> <div class="comment_field"><br />
<br />
<input type="image" class="comment_submit" <br />
src="{site_url}images/interface/send-button.gif" name="submit" value="Submit" /><br />
<br />
</div></p>
<p> {/exp:comment:form}