Page 1 of 1

Help needed, $comment.trace

Posted: Thu Mar 09, 2006 10:08 pm
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?

Re: Help needed, $comment.trace

Posted: Thu Mar 09, 2006 10:45 pm
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