Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » if_comments

#1 2008-10-17 21:35:07

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

if_comments

Hi,

I have the following set up on my home page

<txp:recent_comments label="" break="" limit="5" form="home_recent_comments" />

and the form looks like this:

<div class="home-comments-comment">
<div class="home-comments-gravatar"><a href="<txp:comment_web />"><img src="/4.0/images/gravatar.png" /></a></div>
<p><strong><txp:comment_name /></strong> <span class="small"><txp:comment_time format="/ %b %d" /></span><br />
on <a href="<txp:permlink />" title=""><txp:title /></a></p>
</div>

I want to show a paragraph that says no comments if their are none, i tried added an if statement around the first part and it said i couldnt do that, i added it to the form and nothing happened, how do i do it thanks. x


~ Cameron

Offline

#2 2008-10-17 22:43:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: if_comments

As far as I know if_comments only works inside an article form (checks if an individual article has comments). You could try chh_if_data instead.

Offline

#3 2008-10-17 23:09:09

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: if_comments

That plugin works fine :) wouldn’t a simple if data statement be a default thing in Txp though :S


~ Cameron

Offline

  1. Index
  2. » How do I…?
  3. » if_comments

Board footer

Powered by FluxBB