tips and tricks for movable type

previous and next on your calendar
March 09, 2003

To get little « and » navigational links on your calendar (to move to the previous and next months), use this code:

<caption class="calendarhead"><MTArchivePrevious><a href="<$MTArchiveLink$>" title="<$MTArchiveTitle$>">&laquo;</a></MTArchivePrevious> <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a> <MTArchiveNext><a href="<$MTArchiveLink$>" title="<$MTArchiveTitle$>">&raquo;</a></MTArchiveNext></caption>

If you're using this on your Main Index Template, you'll need to enclose your calendar table in an MTArchiveList container:

<MTArchiveList archive_type="Monthly" lastn="1">
(calendar code)
</MTArchiveList>

Comments

sweetness! you rock! it works it works! is there any way to change the table with the dates to the current displayed month? would this take some other scripting outside of MT? changing the month is pretty slick. thanks girlie!

by Ken Edwards | 03.15.03 12:59 AM

Do you mean making the calendar on the archive pages match the archive month?

<MTCalendar month="this">

If that's not what you meant, could you be a bit more specific?

by girlie | 03.15.03 11:11 AM

nice! yep that was it. thanks!

by Ken Edwards | 03.15.03 01:49 PM

I hate to say this... but I don't understand. I followed your instructions but the end result is nothing like Ken's calendar. What have I done wrong?

by batty | 03.20.03 11:42 PM

I'm new to all this and am not a code person by any means - so please bear with me... :-)

I'm on the design end and am trying to set-up a blog for a customer who is a musician. The page is to be used to list upcoming gigs so there are entries for the current month as well as a month or 2 in advance.

I got the code to work for the > navigation, (which is VERY cool by the way!), BUT now the little calendar is displaying the wrong month name at the top (above the numerical days). It should be March, but it says May (the furthest month out where he has a gig listed).

I want the current month to be showing, (March), even though he might have entries dated into May.

Here's the page:
http://www.ephotowerks.com/projects/test_blog/

Sorry this is sooo long - but any help would be GREATLY appreciated! Thanks - Lori

by Lori | 03.26.03 08:55 PM

Ok I am going to try this out too!!

by iced-glare.org | 04.27.03 12:38 AM

LOL I need to wait until next month to see if it works :-/

by iced-glare.org | 04.27.03 01:29 AM

I get the calendar working in the archive pages, but the Title of the month is always the current month, not the month showing.

Seems like a simple fix - any help?

by Howardgr2000 | 04.27.03 02:28 PM

You're not using the MTArchiveList container tags around it, are you? That's only for the Main Index Template.

by girlie | 04.28.03 05:22 PM

can this be used with the brad choate plugin so that it could show the future and past months with the arrows even if there is no entry?

by iced-glare.org | 05.01.03 11:25 PM

Uh, which Brad Choate plugin? He's written more than one.

by girlie | 05.02.03 11:59 AM

Uhh that would be the one that is calendar related!!

by iced-glare.org | 05.03.03 03:05 AM

i think what howardgr2000 is referring to is that the setting the date context month=this works perfect in adjusting dates within both individual and monthly archives, but the month/year doesn't adjust accordingly. in the monthly archive, you use the archive name (May 2002), but that won't work for individual archive entries since the title is the that of the entry. if my babbling doesn't make any sense, see ken edwards site. he uses your method in his monthly archives, but a static current month for individual entries.

by jeff | 05.05.03 02:05 AM

I seem to be having problems setting this up on my monthly archives. They only show the current month regardless, so in April 2002 instance the month showing on the calendar itself is May 2003.

The previous and next works fine - is there something I am missing?

by Eliza | 05.28.03 07:10 AM

Eliza, in your Monthly Archive Template's calendar code, make sure you're using <MTCalendar month="this">.

by girlie | 05.28.03 07:33 PM

Thank you so much! That solved it ;)

by Eliza | 05.29.03 10:47 AM

I copied and pasted this exactly into my calendar template. (I have it set up as an index template on its own, and it is included into my index page via php) When I click on the

by infinite | 06.09.03 09:55 PM

Is it possible for the arrows to bring up the next/previous calendar only (on Main Index page) and not go to the particular archive page?

I just found your site today and it's very helpful. Thanks!!

by vanity | 06.11.03 03:19 PM

I'm currently using Blogger but about to cross over to MT - could I ask a simple question? Where exactly do I put the tag and in which template (I'm assuming Date-Based Archive)? Thanks, I learning a lot from your site.

by hadge | 06.13.03 09:16 AM

Thanks, Girlie! This is something I have wanted to do, but didn't have the know-how. I'm well pleased :D

by domino | 07.04.03 06:24 AM

Thank you for this tip this is awesome !!!

by Arvind | 07.17.03 03:56 AM

Site rocks! Thanks for the code snipet.

by Alexander | 07.18.03 11:55 AM

As asked earlier...
Is it possible for the arrows to bring up the next/previous calendar only (on Main Index page) and not go to the particular archive page? ....Thanks

by Neel | 09.03.03 11:20 PM

You are too awesome!! I finally got this up and working on my site without to many problems... It looks nice, acts nice, and is just... nice.... thanx (^_^)

by Matt | 10.22.03 02:49 AM

What date context do I enter"? I have tried both numerical and"monthly" this is the error I receive.

Build error in template 'Main Index': Error in tag: You used an without a date context set up.

Thyanks I'M out.....

by marc | 11.07.03 04:49 PM

I'm not sure where exactly to place the code you described. This is what I have:

<div align="center" class="calendar">
<table border="0" cellspacing="4" cellpadding="0" summary="Monthly calendar with links to each day's posts">

<MTArchiveList archive_type="Monthly" lastn="1">

<caption class="calendarhead"><MTArchivePrevious><a href="<$MTArchiveLink$>" title="<$MTArchiveTitle$>">&laquo;</a></MTArchivePrevious> <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a> <MTArchiveNext><a href="<$MTArchiveLink$>" title="<$MTArchiveTitle$>">&raquo;</a></MTArchiveNext></caption>

</MTArchiveList>
<tr>
<th abbr="Sunday" align="center">
<span class="calendar">Sun</span>
</th>
<th abbr="Monday" align="center">
<span class="calendar">Mon</span>
</th>
<th abbr="Tuesday" align="center">
<span class="calendar">Tue</span>
</th>
<th abbr="Wednesday" align="center">
<span class="calendar">Wed</span>
</th>
<th abbr="Thursday" align="center">
<span class="calendar">Thu</span>
</th>
<th abbr="Friday" align="center">
<span class="calendar">Fri</span>
</th>
<th abbr="Saturday" align="center">
<span class="calendar">Sat</span>
</th>
</tr>
<MTCalendar>
<MTCalendarWeekHeader>
<tr>
</MTCalendarWeekHeader>
<td align="center">
<span class="calendar">
<MTCalendarIfEntries>
<MTEntries lastn="1">
<a href="<$MTEntryPermalink$>"><$MTCalendarDay$></a>
</MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries>
<$MTCalendarDay$>
</MTCalendarIfNoEntries>
<MTCalendarIfBlank>&nbsp;</MTCalendarIfBlank>
</span>
</td>
<MTCalendarWeekFooter>
</tr>
</MTCalendarWeekFooter>
</MTCalendar>
</table>
</div>

by Thinks Too Much | 01.16.04 02:17 PM

I would like to ask how, instead of the links in my calendar pointing to the last entry of that day, I can make them point to the archive for that day. I tried using the following, but it doesn't work:

<MTCalendarIfEntries>
<MTArchiveList archive_type="Daily" lastn="1">
<a href="<$MTArchiveLink$>">
<$MTCalendarDay$></a></MTArchiveList>
</MTCalendarIfEntries>

Instead I always get the last daily archive's URL.
Suggestions?

by Nicholas Shanks | 07.06.04 05:57 PM

<MTCalendarIfEntries>
<MTEntries lastn="1">
<a href="<MTEntryPermalink archive_type="Daily">">
<MTCalendarDay></a></MTEntries>
</MTCalendarIfEntries>

;)

by girlie | 07.06.04 06:07 PM

This example works fine for monthly archives but when an individual entry is selected the calendar reverts back to the current month. i.e. select an entry from two months ago and the calendar doesn't reflect the selected months archive entries instead it just shows the entries from the current month. Why is this and can it be fixed?

by soma love [TypeKey Profile Page] | 03.06.05 10:51 AM

Hiya :)
I followed all the instructions and the comments and it all works fine, but I still can't get the correct month to appear on the calendar. No matter how many times I press the previous arrow, the calendar always displays May 2005. Any other suggestions?

I've tried to post my calendar code here, but for some reason, it's not working. If you need to see it, I can email it. Or you can check my site to see it.

by ReneeZara [TypeKey Profile Page] | 05.05.05 03:51 PM

Ooops, forgot to mention that I have it set up so that when I click, the entries open in an iFrame - so the Main Index page doesn't actually change. I think that's why it's not changing. Is there any possible way to make it change though, right there on the Main Index page?

by ReneeZara [TypeKey Profile Page] | 05.05.05 07:58 PM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 13
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/142)

» Lots of things
Excerpt: Well there are a lot of site related things so I will just throw them all together in this post....
Weblog: Breaking Windows
Tracked: 03.21.03 08:30 AM

» Good movabletype tips
Excerpt: Good movabletype tips via the girlie matters
Weblog: Stoyan Zhekov's Weblog
Tracked: 05.01.03 02:38 AM

» Calendars and Sidebars
Excerpt: I added previous and next arrows to my calendar and in doing so realized I also needed a better way to get my sidebar on all my pages....
Weblog: freemoby.com
Tracked: 06.01.03 09:07 PM

» ..site work...
Excerpt: I recently added several features to the blog: Browseable monthly archives from the calendar (the arrows next to month) described hereFixed up some CSSUpgraded my gallery to latest developement of Apache::GalleryMade it so all links going to other site...
Weblog: is a geek
Tracked: 08.18.03 11:30 AM

» MT Tweaks
Excerpt: General, indispensible links for MT setup and configuration include: Movable Type, the girlie matters, Empty Pages, Scriptygoddess, and CSS Zen Garden. To minimize the tehno-babble on this blog while keeping track of this behemoth project, here is the ...
Weblog: patchwork progression
Tracked: 09.02.03 01:45 PM

» calender part 2
Excerpt: And now > at the top of the cal that links to previous and next months. Courtesy of the girlie....
Weblog: the shaky kaiser
Tracked: 09.13.03 07:57 AM

» blog template work: accessible calendar
Excerpt: I am still futzing with the layout of the site. While doing so I found Accessible Calendars and tips and tricks: previous and next on your calendar helpful (moreso in navigating Movable Type stuff). One comment on the Accessible Calendars piece, he (an...
Weblog: ed costello's personal journal
Tracked: 10.13.03 10:58 AM

» http://doping.sics.se/linkflow/archives/2003_10.html#001461
Excerpt: previous and next on your calendar...
Weblog: Emmanuel's Link Flow
Tracked: 10.16.03 03:16 AM

» Adjustments
Excerpt: Added some mods today, including "calendar cell background colors" and the previous and next calendar function. More to come....
Weblog: lingosphere daily
Tracked: 11.12.03 08:37 PM

» Girlie matters: prev and next in your calendars
Excerpt: girlie matters: prev and next in your calendars...
Weblog: lonita.links
Tracked: 03.07.04 06:03 AM

» More Updates
Excerpt: Added total entries and comments to The Low Down thanks to jenni, who points out that the functions are in the MT manual. Girlie's calendar code to add the navigational link to see the previous/next month to the entry calendar...
Weblog: the media drop
Tracked: 03.07.04 04:47 PM

» Previous and Next on the Calendar
Excerpt: [the girlie matters] tips and tricks: previous and next on your calendar...
Weblog: Living Dead Girl
Tracked: 10.19.04 10:47 AM

» The Girlie Matters :: Previous and Next on the Calendar
Excerpt: [the girlie matters] tips and tricks: previous and next on your calendar...
Weblog: Tutorials
Tracked: 10.21.04 07:03 PM