tips and tricks for movable type
category specific recent comments listing
January 16, 2004
In a recent entry, I showed how I used PHP/MySQL to display the lastn comments from a single category. The code can also be modified for use in a Category Archive page, to show recent comments only for that particular category.
This piece of code from the original entry is the one to modify:
(placement_category_id = 54)
If you only assign one category to each entry in your blog, replace 54 with:
<MTEntries lastn="1">
<MTEntryCategories>
<MTCategoryID>
</MTEntryCategories>
</MTEntries>
<MTEntryCategories>
<MTCategoryID>
</MTEntryCategories>
</MTEntries>
If you assign multiple categories to each entry, install the Compare plugin and replace 54 with:
<MTEntries lastn="1"><MTEntryCategories>
<MTIfEqual a="[MTCategoryLabel]" b="[MTEntryCategory]">
<MTCategoryID></MTIfEqual></MTEntryCategories>
</MTEntries>
<MTIfEqual a="[MTCategoryLabel]" b="[MTEntryCategory]">
<MTCategoryID></MTIfEqual></MTEntryCategories>
</MTEntries>
Inspired by this topic in the MT forum.
Comments
I wanna know what is the table template for the blog body. Ive been trying to do so. but I m bad at doing tables! ;) hehehe hope that you can help me. thanks .