Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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
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
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
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
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
Re: If No Comments
Heh. Well, thanks anyway for your attempt.
Offline
Pages: 1