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:
- Go to templates (by clicking on Templates in the left-hand menu bar).
- Under Archive-Related Templates, click on Individual Entry Archive.
- 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.
- Scroll down to <MTEntryIfAllowComments>. Beneath that, next to <div class="comment-body">, type <a name="<$MTCommentID$>"></a>.
- Save.
Then add the code to your Main Index template:
- Go back to the template index (by clicking on Templates in the left-hand menu bar).
- Click on Main Index.
- Copy the template into a text file and save.
- 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>
- Save and rebuild your site.
That should do it. :-)
Posted by iona at September 15, 2003 09:11 AM
It works - but the font/colour doesn't match the rest of my menu. Trying to fiddle with it now...
Sorted - just one minor change:
Recent Comments
#"> on ">
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>
*fiddles a bit*
Like that?