====== txp:comments ====== The ''comments'' tag is a Single Tag. Textpattern will replace this tag with the comments associated with a particular article. Comments will be displayed for the present individual article as a default, or to the article set by the "id" attribute. ===== Syntax ===== The ''comments'' tag has the following syntactic structure... ====== Attributes ====== Tag will accept the following attributes (**case-sensitive**): ===== id="article ID#" ===== The article you want to view comments for. Default is current article. Attribute works only on non-individual article pages. ===== sort="sort value(s)" ===== How to sort the resulting list. Available values: __discussid__ (comment ID#), __parentid__ (article ID#), __name__, __email__, __web__, __ip__ [[http://en.wikipedia.org/wiki/IP_address |IP address]], __posted__, __message__, __rand()__ [[http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand |random]]. Default is __posted asc__. ===== form="form name" ===== Default is __comments__. ===== wraptag="tag" ===== [[http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.1 |(X)HTML tag]] (without brackets) to wrap around list. Default depends upon Present Comments as a Numbered List? preference setting, either __ol__ or unset. ===== break="value" ===== [[http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.1 |(X)HTML tag]] (without brackets) or string used to separate comments. Default depends upon Present Comments as a Numbered List? preference setting, either __li__ or __div__. ===== class="class name" ===== [[http://www.w3.org/TR/html4/struct/global.html#adef-class |(X)HTML class attribute]] to be applied to __wraptag__. Default is __comments__. ===== breakclass="class name" ===== [[http://www.w3.org/TR/html4/struct/global.html#adef-class |(X)HTML class attribute]] to be applied to __break__ (when value supplied is a tag). Default is unset. ======Examples====== ===== Display comments, and give user's an indication of "Comments" status. ===== 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.

Comments are turned off for this article.

Other tags used: <[[txp:comments_form /]]>, <[[txp:if_comments_allowed]]> ===== Column list for displaying id numbers for comments for article id 3, and a comment input form, if comments are currently allowed on article id 3. ===== Tags Form (lineitem) Type(comment) Styles could go this way .special { display:list-item; list-style-type:none; } Other tags used: <[[txp:comment_id /]]>, <[[txp:comments_form /]]>, <[[txp:if_comments_allowed]]>