概要
MTテンプレートで、年表を年別にグルーピングしてみた。
投稿した記事の日付で判定しグループ処理にしています。
グループ化するためには、年別で記事のカウントをしなければいけないため
アーカイブテンプレートのブログ記事でテンプレートを作りました。
アーカイブテンプレート
<div class="inner">
<table border="0" cellspacing="0" cellpadding="0" class="companyTbl">
<$mt:SetVar name="currentYear" value="0"$>
<MTArchiveList archive_type="Yearly">
<mt:Entries sort_by="authored_on" sort_order="descend">
<$mt:EntryDate format="%Y" setvar="year"$>
<tr>
<mt:If name="year" ne="$currentYear">
<th rowspan="<$mt:EntriesCount$>"><$mt:Var name="year"$>年</th>
</mt:If>
<td><$mt:EntryDate format="%m月"$></td>
<td><mt:text_item></td>
<$mt:SetVar name="currentYear" value="$year"$>
</tr>
</mt:Entries>
</MTArchiveList>
</table>
</div><!--/inner-->