Sponsored Link

« Template Backup and Refreshプラグイン | メイン

カレンダー

カレンダーを表示してみました。

まずは、表示のみ。
次に前月へのリンク付きに変更。
そして最後は、カレンダー全体をテンプレートモジュールにしてみました。

テンプレートモジュールには、
calenderという名前で保存をし、以下の内容を記述しました。

<div id="calendar">
<table summary="投稿されたエントリーへのリンク付き月間カレンダー">
<caption>
<script language="JavaScript">
<!--
dat=new Date(); yea=dat.getYear(); if (yea < 2000) yea = yea + 1900;mon=dat.getMonth(); document.write('<a href="<MTBlogURL>archives/'); document.write(yea);
if(mon == "0") { document.write('/12');}else if(mon < "10") { document.write('/0'); document.write(mon);} else{ document.write('/'); document.write(mon);}
document.write('/index.html">≪</a> ');
// -->
</script>
<$MTDate format="%B %Y"$></caption>
<tr>
<th abbr="日曜日">日</th>
<th abbr="月曜日">月</th>
<th abbr="火曜日">火</th>
<th abbr="水曜日">水</th>
<th abbr="木曜日">木</th>
<th abbr="金曜日">金</th>
<th abbr="土曜日">土</th>
</tr>
<MTCalendar>
<MTCalendarWeekHeader>
<tr></MTCalendarWeekHeader>
<td><MTCalendarIfEntries><MTEntries lastn="1">
<a href="<$MTEntryPermalink$>">
<$MTCalendarDay$></a>
</MTEntries></MTCalendarIfEntries>
<MTCalendarIfNoEntries>
<$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank>&nbsp;</MTCalendarIfBlank></td>
<MTCalendarWeekFooter></tr>
</MTCalendarWeekFooter>
</MTCalendar>
</table>
</div>
そして、indexテンプレートのカレンダー挿入位置に、
<$MTInclude module="calender"$>
と記述すれば、OKです。。。よね?

トラックバック

このエントリーのトラックバックURL:
http://baby.s1.xrea.com/x/mt-tb.cgi/4

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)