Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-18 01:51:43

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

show the number of comments and "Write a comment" when the number is 0

How do I show the number of comments and how do I show “Write a comment” if the number is 0. Both linked to the comment form…

Thx,
M

Offline

#2 2005-12-18 02:29:39

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: show the number of comments and "Write a comment" when the number is 0

Comment count can be controlled by either <a href=“http://textpattern.net/wiki/index.php?title=Txp:comments_count_/”>txp:comments_count /</a> or <a href=“http://textpattern.net/wiki/index.php?title=Txp:comments_invite_/”>txp:comments_invite /<a> (the latter with the showcount=“1” attribute).

The text for the <code><txp:comment_invite /></code> link will be taken from the article’s comment invitation field or the default invitation (set in admin —-> preferences), in that order. So far as I know, there is no way to conditionally set a different invitation if there are no comments for an individual entry. Maybe there’s a plugin….

Last edited by Elenita (2005-12-18 02:31:50)

Offline

#3 2005-12-19 06:11:30

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: show the number of comments and "Write a comment" when the number is 0

<txp:if_comments>
	There are comments!
<txp:else />
	There are no comments!
</txp:if_comments>

Offline

#4 2005-12-19 16:05:37

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: show the number of comments and "Write a comment" when the number is 0

Oh, duh. So simple I thought it couldn’t be done.

Offline

Board footer

Powered by FluxBB