Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Mangek
Regular
Posts: 85 Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:
Post
by Mangek » Wed Jun 25, 2008 2:52 pm
Hey guys, my first post and I'd like to take the opportunity to thank you for this wonderful software. :-]
Now to my question, is there a way to have uncommented threads show "Post comment" instead of "Comments (0)" ?
I tried fiddling a little with the smarty code (I think?) but I'm not all that good with the syntax. Here's what I tried:
Code: Select all
{if $entry.has_comments}
<br/><a href="{$entry.link}#comments">{$entry.label_comments} ({$entry.comments})</a>
{else}
<br /><a href="{$entry.link}#comments">Post a comment</a>
{/if}It displays "Post a comment" regardless if there are any comments or not. Any suggestions would be greatly appreciated. :-]
garvinhicking
Core Developer
Posts: 30022 Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:
Post
by garvinhicking » Wed Jun 25, 2008 2:54 pm
Hi!
Maybe the "has_comments" is only used to indicate whether comments are allowed. Try this:
Code: Select all
{if $entry.comments > 0}
<br/><a href="{$entry.link}#comments">{$entry.label_comments} ({$entry.comments})</a>
{else}
<br /><a href="{$entry.link}#comments">Post a comment</a>
{/if}
HTH,
Garvin
Mangek
Regular
Posts: 85 Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:
Post
by Mangek » Wed Jun 25, 2008 2:56 pm
Wow Garvin, that was a really fast and helpful reply!
Thank you so much, that worked great! :-]]