Creating Chronological Threads
Chronological Threads display comments sorted by the date they were posted. If a comment was posted in reply to another, this information is shown inline rather than indenting the entire comment (thus creating a hierarchy). An example of chronological threads is shown in the screenshot below:
The following steps guide you through editing your templates to display chronological threads. These instructions have been tailored to match the default templates. If you have customized your comment templates, these are bound to be different so you will have to adapt the logic:
Open the
Comment Detailtemplate module and search for<$MTCommentAuthorLink default_name="Anonymous" show_email="0"$> <MTIfNonEmpty tag="CommentAuthorIdentity"><$MTCommentAuthorIdentity$></MTIfNonEmpty> said:To change this to a chronological thread, we will need to first check if the comment is a reply (i.e. if it has a parent). If it does, replace
saidwith something more appropriate. Something like this works great:<!-- This displays the commenter's name and is the same as before --> <$MTCommentAuthorLink default_name="Anonymous" show_email="0"$> <MTIfNonEmpty tag="CommentAuthorIdentity"><$MTCommentAuthorIdentity$></MTIfNonEmpty> <!-- Check if the comment has a parent i.e. is it a reply? --> <MTIfCommentParent> <MTCommentParent> <!-- Set the context to the parent --> <a href="#comment-<MTCommentID>">replied to <MTCommentName>'s comment</a> </MTCommentParent> <MTElse> <!-- If this isn't a reply then --> said </MTIfCommentParent>Republish your templates. Your comments should now be in a chronological thread, for example:




Vee said:
on Jan 16, 2008 9:35 PM | Reply
Wow, that looks fantastic!
BTW, how do you get the avatars? They're cool.