Help - Search - Members - Calendar
Full Version: multiple calendars for archiving
Movable Type Community Forum > Additional Resources > Tips and Tricks
poncho
Hi,

I'd like my main archive index to contain calendars for each month of my blog since it started. Users could then click on the days which have links to go to a day-based archive page. Is this possible without using something server-side like PHP?

Effectively what I need is a loop over all

<MTCalendar month="YYYYMM">
...
</MTCalendar>

Hope you can help.
TIA,
poncho
girlie
Try surrounding your calendar code with an MTArchiveList tag:

CODE
<MTArchiveList archive_type="Monthly">

(calendar code)

</MTArchiveList>
scsmith
There's a long thread here about it.

- Steph
SpikeTheLobster
That post doesn't seem to be there any more. sad.gif

Is there an archived version of it somewhere? I've tried putting archive tags round my calendar code, but I just get multiple calendars with the correct monthly title and the wrong days (all for the current month, despite headings).
crys
Here's a fixed version of the link.


but I think all you may need is to change the
CODE
<MTCalendar month="YYYYMM">

to
CODE
<MTCalendar month="this">

so it reads the surounding date context.
SpikeTheLobster
Thanks for that... unfortunately, the basic code isn't anywhere. I've found your post here:

http://www.sillybean.net/archives/2003_01_20.shtml

That covers the style sheet. There's some other entries that give general indications ("put MTArchiveList archive_type="Monthly" around it") and so on... but mine's still screwed. I am now getting every month's name and link, then all the calendars (which at least are correct now! tongue.gif ).

So... here's what I have:

CODE
<center><table border="0" width=150 cellspacing="2" cellpadding="0" summary="Monthly calendar">
<MTArchiveList archive_type="Monthly">
<MTCalendar month="this">
<caption>- <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a> -</caption>
<tr>
<th abbr="Sunday" align="center">Su</th>
<th abbr="Monday" align="center">Mo</th>
<th abbr="Tuesday" align="center">Tu</th>
<th abbr="Wednesday" align="center">We</th>
<th abbr="Thursday" align="center">Th</th>
<th abbr="Friday" align="center">Fr</th>
<th abbr="Saturday" align="center">Sa</th>
</tr>
<td align="center">
<MTCalendarIfEntries><MTEntries lastn="1"><a href="<$MTEntryLink$>"><$MTCalendarDay$></a></MTEntries></MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank> </MTCalendarIfBlank></td>
<div class="quotation"><small><MTCalendarWeekFooter></small></div></tr></MTCalendarWeekFooter>
</MTCalendar>
<p>
</MTArchiveList>
</table></center>


Bear in mind that this might be totally screwed now, since I've been beating my head against it for several hours and am in a less-than-fit-state. smile.gif

My output gives this:

- May 2003 -
- April 2003 -
- March 2003 -
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
(then two more calendars for previous months)

At this point, I'm pretty sure I'm just overlooking something really dumb. A pointer would be really, really nice: my brain hurts. sad.gif

Once the problem's gone, I can figure the style sheets bit. smile.gif Thanks much!
kadyellebee
I think you need to swap a few of the lines around. You had some formatting tags in there that didn't seem to belong, so I snipped them out too.

Try this:
CODE
<center>
<MTArchiveList archive_type="Monthly">
<table border="0" width=150 cellspacing="2" cellpadding="0" summary="Monthly calendar">
<caption>- <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a> -</caption>
<tr>
<th abbr="Sunday" align="center">Su</th>
<th abbr="Monday" align="center">Mo</th>
<th abbr="Tuesday" align="center">Tu</th>
<th abbr="Wednesday" align="center">We</th>
<th abbr="Thursday" align="center">Th</th>
<th abbr="Friday" align="center">Fr</th>
<th abbr="Saturday" align="center">Sa</th>
</tr>

<MTCalendar month="this">
<MTCalendarWeekHeader><tr></MTCalendarWeekHeader>

<td align="center">
<MTCalendarIfEntries>
<MTEntries lastn="1">
<a href="<$MTEntryLink$>"><$MTCalendarDay$></a>
</MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank> </MTCalendarIfBlank>
</td>
<MTCalendarWeekFooter></tr></MTCalendarWeekFooter>
</MTCalendar>

</table>
</MTArchiveList>
</center>


smile.gif
Kristine
SpikeTheLobster
Ahhhhhhh....

Thank you SOOOO much: as I said, my brain's stopped working. Stupid errors always slip in when that happens. That sorted it. Now I can figure out the style stuff and make it fit.

Very, VERY much appreciated, I can assure you. smile.gif
kadyellebee
Glad to help! smile.gif

Kristine
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.