6.17 親カテゴリ配下のカテゴリのブログ記事一覧を表示する ★

P.471

「ブログ記事」アーカイブテンプレート

...前略...
</div>
<h3 class="content-header">このブログ記事に関連するカテゴリのブログ記事</h3>
<div class="content">
<mt:if tag="entryCategory">
  <mt:entryID setvar="entry_id" />
  <mt:topLevelParent>
    <mt:categoryLabel setvar="top_category" />
  </mt:topLevelParent>
  <ul>
  <mt:subCategories include_current="1" category="$top_category">
    <mt:if tag="categoryCount">
      <mt:setVarBlock name="category_name">
    <a href="<mt:categoryArchiveLink />" title="<mt:categoryDescription />"><mt:categoryLabel></a>
      </mt:setVarBlock>
      <mt:entries>
        <mt:entryID setvar="current_entry_id" />
        <mt:if name="current_entry_id" ne="$entry_id">
    <li><a href="<mt:entryPermalink valid_html="1" />"><mt:entryTitle encode_html="1" /></a> [<mt:getVar name="category_name" />]</li>
        </mt:if>
      </mt:entries>
    </mt:if>
  <mt:subCatsRecurse />
</mt:subCategories>
  </ul>
</mt:if>
</div>
<mt:include module="トラックバック" />
<mt:include module="コメント" />
...後略...

★「ブログ記事」アーカイブテンプレート(デフォルトテンプレート)

デフォルトテンプレートの場合、「ブログ記事」アーカイブテンプレートの、トラックバックのincludeタグの直前に、次の001~025のサブテンプレートを追加します。

    ...前略...
      </div>
    </div>
001:<h2 class="comments-header">このブログ記事に関連するカテゴリのブログ記事</h2>
002:<div class="comments-content">
003:<mt:if tag="entryCategory">
004:  <mt:entryID setvar="entry_id" />
005:  <mt:topLevelParent>
006:    <mt:categoryLabel setvar="top_category" />
007:  </mt:topLevelParent>
008:  <ul>
009:  <mt:subCategories include_current="1" category="$top_category">
010:    <mt:ifNonZero tag="categoryCount">
011:      <mt:setVarBlock name="category_name">
012:    <a href="<mt:categoryArchiveLink />" title="<mt:categoryDescription />"><mt:categoryLabel></a>
013:      </mt:setVarBlock>
014:      <mt:entries>
015:        <mt:entryID setvar="current_entry_id" />
016:        <mt:if name="current_entry_id" ne="$entry_id">
017:    <li><a href="<mt:entryPermalink valid_html="1" />"><mt:entryTitle encode_html="1" /></a> [<mt:getVar name="category_name" />]</li>
018:        </mt:if>
019:      </mt:entries>
020:    </mt:ifNonZero>
021:    <mt:subCatsRecurse />
022:  </mt:subCategories>
023:  </ul>
024:</mt:if>
025:</div>
    <$MTInclude module="トラックバック"$>
    <$MTInclude module="コメント"$>
    ...後略...

ウェブページ

Powered by Movable Type 4.261

このアーカイブについて

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。