MT 4 Calendar should link to Daily Archives not last Entry

| No Comments

The Calendar that comes with Movable Type 4.01 links to the last Entry made on a day, instead of to a Daily Archive page for that day - probably because MT 4 doesn't ship with Daily Archives turned on. And, it doesn't highlight the current day.

So, I added MTCalendarIfToday in the Calendar code, created a "today" class in my custom stylesheet template, added a Daily Archive template and set its filename to /yyyy/mm/dd/index.php, and changed the day links in the Calendar code. Works great! The Calendar code changes are:

<div class="widget-calendar widget">
<h3 class="widget-header"><$MTDate format="%B %Y"$></h3>
<div class="widget-content">
<table summary="Monthly calendar with links to each day's posts">

<th abbr="Sunday">Sun</th>
<th abbr="Monday">Mon</th>
<th abbr="Tuesday">Tue</th>
<th abbr="Wednesday">Wed</th>
<th abbr="Thursday">Thu</th>
<th abbr="Friday">Fri</th>
<th abbr="Saturday">Sat</th>
<td <MTCalendarIfToday>class="today"</MTCalendarIfToday>>
<MTEntries lastn="1">
<a href="<$MTEntryLink archive_type="Daily"$>"><$MTCalendarDay$></a>
<MTCalendarIfBlank> </MTCalendarIfBlank></td>

Leave a comment

Sketch of Cheryl

About Cheryl

Enjoys crocheting, gardening, cats, NASCAR (especially Tony Stewart and Kyle Busch!), reading, photography, snorkeling in Kailua-Kona with sea turtles, Sizzler's Mega Bacon Cheeseburgers, hot and iced decaf coffee, dark chocolate, color (yarn, fabric), playing around with web technologies - not necessarily in that order! Still very much a beginner with quilting, knitting, and sewing. Donates crocheted lap blankets.

List maker, detail-oriented, organized, leans heavily toward perfectionism. ISTJ. Libra.

January 2017

Sun Mon Tue Wed Thu Fri Sat
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        
Disclaimer: This is a personal website - my place of self expression. The views expressed are mine alone and do not necessarily reflect the views of my employer or any other organization I am a member of or affiliated with.
Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 5.2.2

About this Entry

This page contains a single entry by Cheryl published on October 23, 2007 7:04 PM.

CSS for Calendar in MT 4 was the previous entry in this blog.

A personal success story: Directory Browsing works! Finally! is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Cat playing with strand of yarn.