Michael asked me to do a version of my script here for categories (It's PHP). It was actually easier to do. (The code for this is shown in the "show more" block)…
but I'm working on doing this as a "show/hide" expand option. (It shows a list of categories, you click on the category and it shows the entries for that category). If this is already done somewhere, save my sanity and post the link… otherwise I'll update this post when I have time to figure it out.
UPDATE: I've now also added the code that uses the "hide/show more" javascript below This also uses a little bit of PHP, but if you need it without, I think there's an easy way to make it 100% javascript.
Ok, here's the code to do the php version of that "show/hide" categories:
<MTCategories>
<a href="<? echo $PHP_SELF."?showcat=<$MTCategoryLabel dirify="1"$>
" ?>"><$MTCategoryLabel$></a><br>
<?
if (isset($showcat) && ($showcat == <$MTArchiveCategory dirify="1"$>)) {
?>
<MTEntries>
» <$MTArchiveDate format="%B %e, %Y %I:%M %p"$>: <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a><br />
</MTEntries>
<? } ?>
</MTCategories>
Demo shown here.
———————————————————————————-
Now here's the code for the same, but using the "show/hide" javascript. (Again there is a little bit of PHP used here, but if you can't use PHP, I think there's a way to make it all javascript). Put the code below in between your <head> </head> tags. (I copied this from Kristine's show/hide archives)
<script language="javascript">
function showMoreCat(archnum, archlink){
hid = ('hide' + (archnum));
unhid = ('click' + (archnum));
if( document.getElementById ) {
if( document.getElementById(hid).style.display ) {
if( archlink != 0 ) {
document.getElementById(hid).style.display = "block";
document.getElementById(unhid).style.display = "none";
} else { document.getElementById(hid).style.display = "none";
document.getElementById(unhid).style.display = "block"; }
} else { location.href = archlink;
return true; }
} else { location.href = archlink;
return true; }
}
</script>
And this is the code for where the category list goes…
<?
$layernum = 100;
?>
<MTCategories>
<span id="click<? echo $layernum; ?>"><a href="<$MTCategoryArchiveLink$>" onclick="showMoreCat(<? echo $layernum; ?>,'<$MTCategoryArchiveLink$>');return false;"><b><$MTCategoryLabel$> (click to show posts)</b></a><br /></span>
<div id="hide<? echo $layernum; ?>" style="display: none">
<a href="#" onclick="showMoreCat(<? echo $layernum; ?>,0);return true;">
<b><$MTCategoryLabel$> (click to close list)</b></a><br>
<MTEntries>
» <$MTArchiveDate format="%B %e, %Y %I:%M %p"$>: <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a><br />
</MTEntries>
<a href="#" onclick="showMoreCat(<? echo $layernum; ?>,0);return true;">
<b>close list</b></a><br><br></div>
<br>
<?
$layernum++;
?>
</MTCategories>
Demo for this shown here.