I want to display a list of categories in a sidebar on my Category Archive Template page. If I enter the code from the Main Index, my category archive sidebar comes up empty (literally, it displays nothing under the categories heading). To fix that, I am calling that same code into my category archive template as a php include.
Create a new index template called categories.php and place in it the sidebar code (from main index template) for your CATEGORIES:
In your Category Archive template, place the following code:
<div id="categories">
<h2>MTInclude Categories</h2>
<$MTInclude file="categories.php"$>
</div>
This should display your category heirarchy just as in the main index. You could also use this method to display recent entries here. I do believe the entire sidebar code would work in your category archive using this method.
(extended entry below is my former not-so-brilliant method... don't bother reading it)
<div id="categories">
<h2>Categories</h2>
<ul>
<MTEntryCategories blog_id="n">
<li><a href="<$MTCategoryArchiveLink$>" title="<$MTCategoryDescription$>"><MTCategoryLabel></a>
</li>
</MTEntryCategories>
</ul>
</div>
where "n" (above) equals your blog_id number. (obviously!) If you remove the blog_id from this code, it will return categories from all the blogs on your installation.
Mind you, I consider this a temporary solution and will continue to work on this as time permits. Note that this ONLY displays non-empty categories and in non-heirarchical fashion (no subcategories).
See newer, better solution at top of this entry.
