Adding recent Comments to the sidebar

| | Comments (0) | TrackBacks (0)

A common blog widget is the Recent Comments widget, which strangely enough has not been included in the default Movable Type templates. If you want to show the last five comments in your sidebar, follow these steps to adapt your templates:

First open your sidebar template module and find the place where you want to show the recent comments. I suggest that you place them under the recent entries widget. Insert the following code in the template:

<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>

Save the template and open the template of the page where you want to show the comments on, for example the Main Index or the Entry Archive. Add the following line to the template:

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

Categories:

Leave a comment

0 TrackBacks

Listed below are links to blogs that reference this entry: Adding recent Comments to the sidebar.

TrackBack URL for this entry: http://mt.ai-no.com/mt-tb.cgi/1005