2.4 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | form |
|
form
The form object is used within the form tag. It contains attributes of its parent form.
{% anchor_link "form.author", "form-author" %}
Returns the name of the author of the blog article comment. Exclusive to form tags with the "article" parameter.
{% anchor_link "form.body", "form-body" %}
Returns the content of the blog article comment. Exclusive to form tags with the "article" parameter.
{% anchor_link "form.email", "form-email" %}
Returns the email of the blog article comment's author. Exclusive to form tags with the "article" parameter.
{% anchor_link "form.errors", "form-errors" %}
Returns an array of strings if the form was not submitted successfully. The strings returned depend on which fields of the form were left empty or contained errors. Possible values are:
- author
- body
- form
Input
Output
You can apply the default_errors filter on form.errors to output default error messages without having to loop through the array.
Input
Output
{% anchor_link "form.posted_successfully?", "form-posted_successfully" %}
Returns true if a comment by the user was submitted successfully, or false if the form contained errors.