new_comment
Generate a form for new comments on blog posts.
Parameters
form_type{String}The type of form, always set to "localization".article{Object}The article object.
Inputs
| Input | Type | Field Name | Required | Notes |
|---|---|---|---|---|
| Name | text | comment[author] | Required | The name of the comment author. |
| comment[email] | Required | The email address of the comment author. | ||
| Comment | textarea | comment[body] | Optional | The body of the comment. |
Example
{{#form 'new_comment' article}}
{{#if form.posted_successfully}}
<div>Submitted successfully</div>
{{/if}}
{{#if form.errors}}
<div>{{ form.errors.messages }}</div>
{{/if}}
<div class="name">
<label for="name">Name</label>
<input type="text" name="comment[author]" value="{{ form.author }}">
</div>
<div class="email">
<label for="email">Email</label>
<input type="email" name="comment[email]" value="{{ form.email }}">
</div>
<div class="comment">
<label for="comment">Comment</label>
<textarea name="comment[body]">{{ form.body }}</textarea>
</div>
<div class="submit">
<input type="submit" value="Post">
</div>
{{/form}}
Was this article helpful to you?