Help - Search - Members - Calendar
Full Version: Restricting archive entries to a single month
Movable Type Community Forum > Additional Resources > Tips and Tricks
Pedestrian
A problem I didn't even know was a problem until yesterday:

My weblog launched on November 7, so it's just entered its second month of existence. It's been quite an almost-month. I've posted many, many entries and made many, many changes.

One of these changes was to the monthly archive format. I wasn't happy with any of the default possibilities, so I created my own, which I called the "Calendar Based Archive." It's a listing of the titles of all the month's posts, with links to the individual-entry pages. You can see what's supposed to be November's version here:

http://pedestrian.americancultist.com/archives/2002_11.html

Look closely and you can see the problem. The date header says "NOVEMBER 2002," but my December posts are listed up top. Likewise, my nascent December archive also has everything I've ever posted, November and December.

Here's the code I used to create the entry list:

<MTArchiveList>

<MTEntries>

<div class="blogbody">
<a href="<$MTArchiveLink archive_type="Individual"$>"><$MTEntryTitle$></a> / <$MTEntryDate format="%A, %B %e"$>
</div>

</MTEntries>

</MTArchiveList>

I've been looking for ways to fix the problem. I was sure adding archive_type="Monthly" to the MTArchiveList tag would do the trick, but alas, it didn't.

I am at a loss. I must have functioning monthly archives, especially now that I've posted in more than one month! Can you help a brother out?
bmk
So you made a brand new archive template?  Is it listed on your blog config>archiving screen?  You need to add that as a monthly archive type there.  Then MT will automatically know which month's entries to put on which page.

Does that make sense?  It's a little confusing.
bmk
Oh, I see.  If you have the template set up properly in blog config, the problem is probably coming from your tags.... remove the
CODE
<MTArchiveList>

and
CODE
</MTArchiveList>

container when listing on monthly archive pages.
Pedestrian
Ah, yes -- to answer your questions, it's all configured to be the monthly archive, and I already tried your suggestion. What happens is all the titles stay correct, but they all start to link to the same post, my first. That's why I inserted the MTArchiveList tags in the first place, if I recall correctly.
bmk
I see.  Yes, leave the MTArchivelist out.

Try
CODE
MTEntryLink archive_type="Individual"

instead of
CODE
MTArchiveLink archive_type="Individual"
Pedestrian
Hey, it worked! Obviously some kind of dunderheaded move on my part. Thanks a million!
bmk
Cool.  Yeah, it just takes practice with the tags.  :)  Glad I could help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.