Learning Movable Type: Displaying Categories


See the following steps for configuring your weblog for creating and assigning categories, and adding a "Posted to" line at the end of each entry.

Create and assign categories.

When you create a new entry, right next to the Title window is a scroll bar for selecting a category. Scroll down to "Add new category". This will open a window for you to type in the name of the new category. Save your entry in draft mode.

If you have other new categories to add to which you want your entry assigned, repeat the above process with each new category, saving in draft mode after each new category is created. You can assign multiple categories by selecting "assign multiple categories".

Alternatively, you can click on the "categories" button on the left side of your weblog edit window. There are fields for up to five new categories. Enter the categories you want, select save, and then rebuild.

Add a "Posted to" line at the end of each entry.

In the Main Index template, find the following block of code:

<p class="entry-footer">
<span class="post-footers">Posted by <$MTEntryAuthorDisplayName$> at <$MTEntryDate format="%X"$></span> <span class="separator">|</span> <a class="permalink" href="<$MTEntryPermalink$>">Permalink</a>
<MTIfCommentsActive>| <a href="<$MTEntryPermalink$>#comments">Comments (<$MTEntryCommentCount$>)</a></MTIfCommentsActive>
<MTIfPingsActive>| <a href="<$MTEntryPermalink$>#trackback">TrackBacks (<$MTEntryTrackbackCount$>)</a></MTIfPingsActive>
</p>


Add the following code before the closing closing p tag of the code above.

<br />Posted to <MTEntryCategories glue=" | ">
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$>
</a></MTEntryCategories>

Save and rebuild your Main Index template.


In your Individual Entry Archive Template, find the following code:

<p class="entry-footer">
<span class="post-footers">Posted by <$MTEntryAuthorDisplayName$> on <$MTEntryDate$></span> <span class="separator">|</span> <a class="permalink" href="<$MTEntryPermalink$>">Permalink</a>
</p>

Add the following code before the closing span tag or p tag of the code above.

Posted to <MTEntryCategories glue=" | ">
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$>
</a></MTEntryCategories>

Save template and rebuild your files.


Links:
Faceted Categories - Pixel's Charmer's method for displaying subcategories. Not for the faint-hearted.
Category Customizations - LMT tutorial
http://www.nonplus.net/software/mt/Per-CategoryTemplates.htm - Per-category template customizations using Supplemental Category Tags plugin


Posted by Elise Bauer on July 16, 2004 10:11 AM to Learning Movable Type http://www.learningmovabletype.com/