Help needed, $comment.trace

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Help needed, $comment.trace

Post by carl_galloway »

Hi all, I'm working on completely re-structuring the comments on the detail page of a theme.

I want to adjust the css class associated with comments so that in threaded mode the all child comments have a different background from the parent comment. Is there some smarty code I can use to check if $comment.trace includes a period and then apply a different style to this comment?

If this is possible, I also need to determine what mode the comments are being viewed in, either linear or threaded, is this possible?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Help needed, $comment.trace

Post by garvinhicking »

Instead of parsing $comment.trace, you should think about checking the $comment.depth variable. It should be set to "0" for the parent comment and > 0 for all following comments.

You can check which mode is being displayed via the $entry.viewmode variable, which is also checked in the entries.tpl file. I think this variable should also be available when printing comments; if not you might need to play with the {assign} smarty command...Personally I haven't done that yet and I'm also not 100% fit on how Smarty propagates variables between different template files...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply