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:

Vox Chronological Threads

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:

  1. Open the Comment Detail template module and search for

    <$MTCommentAuthorLink default_name="Anonymous" show_email="0"$> <MTIfNonEmpty tag="CommentAuthorIdentity"><$MTCommentAuthorIdentity$></MTIfNonEmpty> said:
    
  2. 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 said with 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>
    
  3. Republish your templates. Your comments should now be in a chronological thread, for example:

    Chronological Threads in Movable Type

1 Comments

Vee said:
on Jan 16, 2008 9:35 PM | Reply

Wow, that looks fantastic!

BTW, how do you get the avatars? They're cool.

About

This is part of the official user manual for Simply Threaded, a plugin for Movable Type by Arvind Satyanarayan.

More Information »

Screenshots

Click a screenshot to browse through the gallery or the arrows to flip through them

←→

I Heart Melody