Skinning and designing Serendipity (CSS, HTML, Smarty)
Janine
Regular
Posts: 13 Joined: Tue Apr 03, 2007 8:48 am
Post
by Janine » Sun Nov 11, 2007 2:19 pm
The code below shows the Title for the comments, if comments should be showed linear or threaded and the comments itself!
I want the line with which you can select linear or threaded to be visible only when there are comments. I tried to place the bold code within:
{if $entry.has_comments}
[bold code]
{/if}
But this doesnt work! Does anyone has a working solution?
Thank you,
Janine Ringers
Code: Select all
{if $is_single_entry and not $is_preview}
<div class="serendipity_comments serendipity_section_comments">
<a id="comments"></a>
<div class="serendipity_commentsTitle">{$CONST.COMMENTS}</div>
<div [b]class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
{if $entry.viewmode eq $CONST.VIEWMODE_LINEAR} ({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
{else}
(<a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})[/b]
{/if}
</div>{serendipity_printComments entry=$entry.id mode=$entry.viewmode}<br>
garvinhicking
Core Developer
Posts: 30022 Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:
Post
by garvinhicking » Sun Nov 11, 2007 2:22 pm
Hi!
Hm, but what you wrote actually should work, yes.
For me, this here does the trick:
Code: Select all
{if $entry.comments > 0}
<div class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
{if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
{else}
(<a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
{/if}
</div>
{/if}
(Maybe using $entry.comments > 0 instead of $entry.has_comments is better. I don't remember if has_comments is maybe only used when comments are unmoderated, not only if there are more than 0 comments)
Regards,
Garvin
Janine
Regular
Posts: 13 Joined: Tue Apr 03, 2007 8:48 am
Post
by Janine » Sun Nov 11, 2007 2:26 pm
Your solution works, thanks alot!
I love Serendipity!