The comments_form tag can be used as a single tag or a container tag and is used to display a comment form. Comments will be attached to present individual article as a default, or to the article set by the
Tag will accept the following attributes (case-sensitive) as well as the global attributes :
- Use specified form template.
Common presentational attributes
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
class="CSS class name"
classto apply to the
comments_form(see class cross-reference).
- HTML tag to wrap around output, specified without brackets (e.g.
- Default: unset (but see wraptag cross-reference for exceptions).
Example 1: Give visitors indication of ‘Comments’ status
Comments for articles can be turned on or off at the author’s discretion for any article that is published; by using the following scheme in an article form, you can still have the on/off control over comments while still giving users indication of comment status:
<txp:if_comments_allowed> <txp:comments_form /> <txp:else /> <p>Comments are turned off for this article.</p> </txp:if_comments_allowed>
Example 2: Display conditional comments and form
<txp:if_comments_allowed> <txp:comments form="lineitem" break="li" wraptag="ul" /> <txp:comments_form /> </txp:if_comments_allowed>
And then an example of what the form
lineitem could contain:
For the current article, returns a list of id numbers for comments and a comment input form (but only if comments are currently allowed).
Can be used as a container tag.
msgstyle attribute deprecated.
submitlabel attributes deprecated and functionality moved to individual
comment_* input tags.
show_preview attribute removed.