MovableBlog: MT Archives Indicator

Nuance 2.0

March 15, 2003

As for the code that I use for the archives indicator (click on a monthly archive in the sidebar and it not only disables the link for the archive, but changes the background colour of the text), here it is.

<p><b>Archives</b><br />

<MTArchiveList archive_type="Monthly">

if (!eregi("<$MTArchiveDate format="%Y_%m"$>", $_SERVER['PHP_SELF']))
print "<a href=\"<$MTArchiveLink$>\"><$MTArchiveTitle$></a>";
else print "<span class=\"greyback\"><$MTArchiveTitle$></span>";

?><br />

It exists on every page with a sidebar (with a few exceptions) because the above code is in a Template Module called "Archives Listing". I then put <$MTInclude module="Archives Listing"$> in where the sidebar appears in my regular (i.e. Index, Individual and Monthly) templates.

In your CSS, you will need something like this:

background-color: #CCCCCC;

Of course, you can chose any colour you want, with an appropriate CSS class name.

Posted by Richard at 1:03