We’re running an events calendar by creating posts in a category and dating the posts with the date of the event. This is all working fine. The unintended side-effect is that an ArchiveList type=”Monthly” tag now outputs months in the future, which we don’t really want.
Is there a built-in way to suppress those? I’ve been trying to do it by comparing the current date with the archive date in the archive list, and only printing out list items that are older than the current date, but it’s not working at all.
I’ve tried several variations on the following code, although it really seems like this should work:
<mt:Date format="%Y%m" setvar="currentMonth" />
<mt:ArchiveList archive_type="Monthly">
<mt:ArchiveDateEnd format="%Y%m" setvar="archiveMonth" />
<mt:If var="archiveMonth" le="$currentMonth">
<p><$mt:ArchiveTitle$></p>
</mt:If>
</mt:ArchiveList>
If I include <mt:Var name="archiveMonth" /> and <mt:Var name="currentMonth" /> in the output paragraph, both show the values I would expect.
However, it seems like the mt:If tag is not getting checked at all; all months print out.
Any pointers on either how to achieve what I’m after, or what I might be doing wrong in that block up there?
Reported on Movable Type 4.2

David - Your code worked for me in MT4.2.
You're doing it exactly as I would suggest.
To test I placed the following code into an index template and then published an entry in the future. (sounds funny =)
<ul> <mt:ArchiveList archive_type="Monthly"> <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$> (<$mt:ArchiveCount$>)</a></li> </mt:ArchiveList> </ul> <hr /> <mt:Date format="%Y%m" setvar="currentMonth" /> <p>currentMonth: <$mt:var name="currentMonth"$></p> <ul> <mt:ArchiveList archive_type="Monthly"> <mt:ArchiveDateEnd format="%Y%m" setvar="archiveMonth" /> <mt:If var="archiveMonth" le="$currentMonth"> <li><$mt:ArchiveTitle$> [<$mt:var name="archiveMonth"$>]</li> </mt:If> </mt:ArchiveList> </ul>Here's the ouput:
What plugins do you have installed?