This is the blog of Adam Kalsey. Unusual depth and complexity. Rich, full body with a hint of nutty earthiness.
Excerpt: MT plugin that groups your archives under a date header. Read the whole article…
You're right. I don't know how I managed to mess that one up. It's fixed now.
Would this work on category archives as well? Say if i wanted to display a category archive and group them by month?
No. If you use this inside an archive that isn't Monthly or Weekly, then the tag won't return anything at all.
I'd like to see a tag for better formatting possibilities. For instance, I'd like to have the year, followed by the months as an unnumbered list, but there is no way to add a closing tag after the months with this plugin.
It's nice. But I'd like to build a nested set of list elements. I can kick off a list with a *ul* in *MTArchiveDateHeader*, but without *MTArchiveDateFooter* I can't close it again with its */ul* tag.
Is there anyway I can use both? so if I display my entries by weeks (which I do) it can then display... 2003 January 01/01/03-07/01/03 08/01/03-etc... Feburary 03/02/03-
Nevermind I'm being slighty stupid... I've worked out a way of doing more or less the same thing
This is a great little plugin, just what I've been looking for. But....is there a way to list only a single year?
There's no way to do that with the plugin or with the built-in MT template tags.
How can I reverse the months? i.e. 2002 jan feb mar... 2001 jan mar apr...
What you'd need is a way of reversing the archive sort order. I don't MT can do that natively, but you might find a plugin that does it if you hunt around at http://mt-plugins.org
This is just what I've been looking for. Thanks for putting the time in on this plugin.
Found a bug. If the archive_type="Weekly", then a new header is generated for each archive entry. Here's the offending code: } elsif ($at eq "Weekly"){ $this_date = substr $ts, 5, 6; This extracts the 6-character substring starting at zero-based offset 5. Unforunately, this captures the 2nd digit of the month, the day, and part of the zero-padding. So, it's unique for each entry. These lines should read: } elsif ($at eq "Weekly"){ $this_date = substr $ts, 4, 2; Grab the 2 characters (the month) at zero-based offset 4. The datestamp from $ts is chars 0-3 (year), 4-5 (month), and 6-7 (day).
If you want to handle Daily archives with per-month headers as well, the following if..elsif..else statement will do it nicely: if ($at eq "Monthly") { $this_date = substr $ts, 0, 4; } elsif ($at eq "Weekly"){ $this_date = substr $ts, 4, 2; } elsif ($at eq "Daily"){ $this_date = substr $ts, 4, 2; } else { return ''; }
Forgot to thank you so.. Thanks :)
To generate nested lists of archives you can use this plugin together with Brad Choate's MTPerlScript plugin, with your template something like this: ----- <ul> <MTArchiveList archive_type="Monthly"> <MTArchiveDateHeader> <li><$MTArchiveDate format="%Y"$> <ul> </MTArchiveDateHeader> <li><$MTArchiveDate format="%B"$></li> <MTPerlScript> $a = '<MTArchivePrevious><$MTArchiveDate format="%Y"></MTArchivePrevious$>'; $b = '<$MTArchiveDate format="%Y"$>'; if ($a ne $b) {print "</ul></li>"}; </MTPerlScript> </MTArchiveList> </ul> ----- Example of output: <ul> <li>2003 <ul> <li>February</li> <li>January</li> </ul> </li> <li>2002 <ul> <li>December</li> <li>November</li> <li>October</li> </ul> </li> </ul>
Excerpt: しました。 Archive Date Header Pluginを入れて。 ソースも書いてあるので、そちらを参考に。...
Excerpt: In the Movable Type support forums I’ve seen requests for the ability to group archives by date. Most of the time, people want to have an archive index. There have been a few people that have posted solutions using PHP...
This discussion has been closed.
Torgny
August 4, 2002 5:35 AM
Shouldn't that link have been: http://kalsey.com/tools/mtplugins/files/ArchiveDateHeader.zip