September 15, 2003

How to add a 'Recent Comments' list to your MT blog

This procedure is specific to Moveable Type. I wrote it late last night. Anyone wanna try it out and see if it works?

First add the anchor to your template:

  1. Go to templates (by clicking on Templates in the left-hand menu bar).

  2. Under Archive-Related Templates, click on Individual Entry Archive.

  3. Copy the template into a text file and save, so that if this doesn't work, you can paste the current template back in, rather than being left with a bewildering mess on your hands.

  4. Scroll down to <MTEntryIfAllowComments>. Beneath that, next to <div class="comment-body">, type <a name="<$MTCommentID$>"></a>.

  5. Save.

Then add the code to your Main Index template:

  1. Go back to the template index (by clicking on Templates in the left-hand menu bar).
  2. Click on Main Index.
  3. Copy the template into a text file and save.
  4. Before <div class="sidetitle">Archives</div>, paste the following:

    <div class="sidetitle">Recent Comments</div>

    <div class="side"><MTComments lastn="10" sort_order="descend"> <MTCommentEntry> <a href="<$MTEntryLink$>#<$MTCommentID$>"> <$MTCommentAuthor$></a> on <a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br /> </MTCommentEntry> </MTComments></div>
  5. Save and rebuild your site.
  6. That should do it. :-)

    Posted by iona at September 15, 2003 09:11 AM
Comments

It works - but the font/colour doesn't match the rest of my menu. Trying to fiddle with it now...

Posted by: Fi at September 15, 2003 06:56 PM

Sorted - just one minor change:

Recent Comments


#"> on ">

Posted by: Fi at September 15, 2003 07:00 PM

ooops. I hate when it reads it has html when I don't want it to be. Um... instead of <P> I put <div class="side"> and instead of </P> put </div>

Posted by: Fi at September 15, 2003 07:04 PM

*fiddles a bit*

Like that?

Posted by: iona at September 15, 2003 07:33 PM

yup, that orta do it.

Posted by: Fi at September 16, 2003 10:45 PM