The comments_form tag is a Single Tag. Textpattern will replace this tag with a comment form. Comments will be attached to present individual article as a default, or to the article set by the “id” attribute.
The comments_form tag has the following syntactic structure…
<txp:comments_form />
Tag will accept the following attributes (case-sensitive):
The ID# assigned to the article you are adding comments to. Default is current article ID#.
(X)HTML size attribute to be applied to (X)HTML form input output. Default is 25.
(X)HTML cols attribute to be applied to (X)HTML form textarea output. Default is 25.
(X)HTML rows attribute to be applied to (X)HTML form textarea output. Default is 5.
(X)HTML style attribute to be applied to (X)HTML form textarea output. Recommended that you use CSS via textarea's class or id attribute instead.
Use specified form. Default is comment_form. See Form.
(X)HTML class attribute to be applied to wraptag. Default is comments_form.
(X)HTML tag (without brackets) to wrap around output. Default is unset.
Comments for articles can be turned off or on at the authors 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>
Other tags used: <if_comments_allowed>
Using some conditional tags the size of the comment input text area can be changed in the preview.
<txp:if_comments_preview> <txp:comments_preview form="comments" /> <p style="color:red;">This is just a preview of your comment!</p> <txp:comments_form isize="30" msgcols="55" msgrows="5" /> <txp:else /> <txp:if_comments_allowed> <txp:comments_form isize="30" msgcols="55" msgrows="15" /> </txp:else /> <p>Comments are turned off for this article.</p> </txp:if_comments_allowed> </txp:if_comments_preview>
Other tags used: <comments_preview />, <if_comments_allowed>, <if_comments_preview>
Tags:
<txp:if_comments_allowed id="3"> <txp:comments id="3" form="lineitem" break="li" wraptag="ul" breakclass="special" /> <txp:comments_form id="3" /> </txp:if_comments_allowed>
Form (lineitem) Type(comment):
<small><txp:comment_id /></small>
Styles could go this way:
.special { display:list-item; list-style-type:none; }
Other tags used: <comment_id />, <comments />, <if_comments_allowed>