Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » If No Comments

#1 2006-02-06 03:35:20

Zahra
New Member
From: Samsara
Registered: 2004-05-16
Posts: 4
Website

If No Comments

If there are no comments for a post, is there a way to display something that explicitly states that “There are no comments”?

I’ve tried using the following:
<b>< txp:if_comments>
< txp:comments />
< txp:else />
There are no comments for this post.
< /txp:if_comments></b>

but it always displays “There are no comments…” even if there <b>are</b> comments.

Am I using if_comments in the wrong way, and if so, is there some other way to do this?

Offline

#2 2006-02-06 06:10:40

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: If No Comments

Don’t know if this is what you need or not, but try this:

<txp:if_comments>
<p><txp:comments_count /> Comments</p>
<txp:else />
<p>No Current Comments</p>
</txp:if_comments>
<br />
That code came from this page: <a href=“http://textpattern.net/wiki/index.php?title=Txp:if_comments”>Here</a>

Last edited by deronsizemore (2006-02-06 06:10:53)

Offline

#3 2006-02-06 12:37:56

Zahra
New Member
From: Samsara
Registered: 2004-05-16
Posts: 4
Website

Re: If No Comments

deronsizemore:

I tried that but it still seems to show just the “No current comments” part, even if there are comments. Maybe if_comments is broken? :/

Offline

#4 2006-02-06 14:43:51

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: If No Comments

I remember having had the same problem. I don’t have a solution, though, since I decided to just skip this and don’t worry about it anymore.

But I support your statement (did you make a statement? :) that if_comments might be broken…


Prrrrrrrr

Offline

#5 2006-02-06 15:17:32

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: If No Comments

Don’t know what’s going on then. I’m sorry…I’m still kinda new to txp so I’m out of ideas. :-)

Offline

#6 2006-02-06 20:10:46

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: If No Comments

Where are you using this code Zahra and what version of TXP are you on?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#7 2006-02-06 21:51:23

Zahra
New Member
From: Samsara
Registered: 2004-05-16
Posts: 4
Website

Re: If No Comments

thebombsite:
I have tried putting this code on both the comments_display form and on an individual article’s archive page.

Using version 4.02.

Offline

#8 2006-02-07 00:02:54

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: If No Comments

It won’t work in the page but should in the comments_display form. And 4.0.2 was when the behaviour of the tag changed to what we know it as now so again it should work. I’m bamboozled. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#9 2006-02-07 00:08:52

Zahra
New Member
From: Samsara
Registered: 2004-05-16
Posts: 4
Website

Re: If No Comments

Heh. Well, thanks anyway for your attempt.

Offline

  1. Index
  2. » Archives
  3. » If No Comments

Board footer

Powered by FluxBB