6.18 カテゴリ一覧に、月別アーカイブリストのタイトルを表示する ★
P.473
「カテゴリアーカイブ」ウィジェットテンプレート(サンプルテンプレート)
<mt:ifArchiveTypeEnabled archive_type="Category">
<mt:if tag="blogCategoryCount">
<dt class="sidetitle">カテゴリ一覧</dt>
<dd class="side">
<mt:topLevelCategories>
<mt:subCatIsFirst><ul></mt:subCatIsFirst>
<mt:if tag="categoryCount">
<li><a href="<mt:categoryArchiveLink />" title="<mt:categoryDescription />"><mt:categoryLabel></a>
<mt:ifArchiveTypeEnabled archive_type="Category-Monthly">
<mt:archiveList archive_type="Category-Monthly">
<mt:archiveListHeader>
<ul class="tree">
</mt:archiveListHeader>
<li class="tree-list<mt:archiveListFooter> tree-list-end</mt:archiveListFooter>"><a href="<mt:archiveLink />"><mt:archiveTitle /></a> [<mt:archiveCount />]</li>
<mt:archiveListFooter>
</ul>
</mt:archiveListFooter>
</mt:archiveList>
</mt:ifArchiveTypeEnabled>
<mt:else>
<li><mt:categoryLabel>
</mt:if>
<mt:subCatsRecurse />
</li>
<mt:subCatIsLast></ul></mt:subCatIsLast>
</mt:topLevelCategories>
</dd>
</mt:if>
</mt:ifArchiveTypeEnabled>
★「カテゴリアーカイブ」ウィジェットテンプレート(デフォルトテンプレート)
元のテンプレートに011~021を追加しています。追加内容はサブテンプレートと同じですが、ul要素li要素のclass属性の部分は、既存のclass属性値を残しています。
001:<mt:IfArchiveTypeEnabled archive_type="Category">
002:<div class="widget-archive widget-archive-category widget">
003: <h3 class="widget-header">カテゴリ</h3>
004: <div class="widget-content">
005: <mt:TopLevelCategories>
006: <mt:SubCatIsFirst>
007: <ul class="widget-list">
008: </mt:SubCatIsFirst>
009: <mt:IfNonZero tag="mt:CategoryCount">
010: <li class="widget-list-item"><a href="<$mt:CategoryArchiveLink$>"<mt:IfNonEmpty tag="mt:CategoryDescription"> title="<$mt:CategoryDescription$>"</mt:IfNonEmpty>><$mt:CategoryLabel$> (<$mt:CategoryCount$>)</a>
011: <mt:ifArchiveTypeEnabled archive_type="Category-Monthly">
012: <mt:archiveList archive_type="Category-Monthly">
013: <mt:archiveListHeader>
014: <ul class="widget-list tree">
015: </mt:archiveListHeader>
016: <li class="widget-list-item tree-list<mt:archiveListFooter> tree-list-end</mt:archiveListFooter>"><a href="<mt:archiveLink />"><mt:archiveTitle /></a> [<mt:archiveCount />]</li>
017: <mt:archiveListFooter>
018: </ul>
019: </mt:archiveListFooter>
020: </mt:archiveList>
021: </mt:ifArchiveTypeEnabled>
022: <mt:Else>
023: <li class="widget-list-item"><$mt:CategoryLabel$>
024: </mt:IfNonZero>
025: <$mt:SubCatsRecurse$>
026: </li>
027: <mt:SubCatIsLast>
028: </ul>
029: </mt:SubCatIsLast>
030: </mt:TopLevelCategories>
031: </div>
032:</div>
033:</mt:IfArchiveTypeEnabled>