December 18, 2003

Created a Category Archive Index

Posted at 08:37 PM Gems, Notebook, Too Done List

I created a Category Archive Index template in the Index Templates section. It creates the file, listing all categories, with their descriptions, and the entries in them. It also uses <a name="..."> to create links to anchors within the document, which I use to build a menu bar at the top of the document.

To do this yourself, create a new index template called CategoryIndex.

Copy the default MasterArchive index template to your new CategoryIndex template.

Insert the code below into CategoryIndex, replacing the <MTArchive> container.

<div align="center">
<MTCategories glue=" | ">
    <a href="#<$MTCategoryLabel$>"><$MTCategoryLabel$></a>
<div> </div>
    <dt><a name="<$MTCategoryLabel$>"></a><a
     (<$MTCategoryCount$>)</strong></h3></a> </dt>
        <a href="<$MTEntryLink$>"><strong><$MTEntryTitle$></strong></a> :: 
        <MTEntryCategories glue=" | ">
        <a href="<$MTCategoryArchiveLink$>"><em><$MTCategoryLabel$>
        </em></a> </MTEntryCategories><br />
      <br /><br />

When you rebuild, there'll be a new CategoryIndex in your blog root directory. Just add links in your other templates and you're ready to go.

Presently listening to:
September Fifteenth - Pat Metheny & Lyle Mays - As Falls Wichita, So Falls Wichita Falls (07:45)

Posted by Patrick at December 18, 2003 08:37 PM