Adding recent comments to the MT sidebar

When I started using the default templates coming with Movable Type 4, I missed the Recent Comments widget. Below I explain how you can add create this widget and ass it to your sidebar in true MT4 style.

In the Movable Type administrative interface, go to Design > Templates > Template Modules and open either the 'Sidebar - 2 Column Layout' or the 'Sidebar - 3 Column Layout' template module, depending on which one you are using. Scroll down until you find a line with <MTIf name="module_recent_comments"> and paste the following code just above that line (you can of course also choose another position for the recent comments widget):

<MTIf name="module_recent_comments">
<div class="widget-archives widget">
<h3 class="widget-header">Recent Comments</h3>
<div class="widget-content">
<ul class="widget-list">
<MTComments lastn="5" sort_order="descend">
<MTCommentEntry>
<li class="widget-list-item"><a href="<$MTEntryPermalink$>#comment-<$MTCommentID$>"><$MTCommentAuthor$></a> on <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li>
</MTCommentEntry>
</MTComments>
</ul>
</div>
</div>
</MTIf>
Now in any template where you want to show the recent comments (e.g. the main index template or the individual archive template) you add the following line:

<MTSetVar name="module_recent_comments" value="1">


Rebuild your weblog, and it should show you the five latest comments in the sidebar, just as you can see on this blog.

1 TrackBack

Movable Type 4のバグ・フィックス版として、バージョン4.01が18日にリリースされています。主にはバージョン4のファーストリリースからのバグ・フィックスとパフォーマンスの改善が施されているそうです。 Read More

Leave a comment

Monthly Archives

Recent Entries

  • Comments and tweets

    A recent trend in the blogosphere has been to add **tweets as comments** on posts. I understand where this comes from, as in general...

  • Manifiesto «En defensa de los derechos fundamentales en internet»

    Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información...

  • Commenting not possible

    I just discovered that it currently is not possible to comment on this blog. At first sight it looks like the problem is caused...

  • Back from the CeBIT

    I am back from the CeBIT show. Actually, I came back on Monday, but have been too busy to post. This year has been...

  • Downloading viruses?

    I just saw the screen above, which is the ClamWin antivirus software uploading its virus database. On the left hand side they have an animation...

Close