前回の次回予告は
パンくずナビゲーション部分を作る
くれま先輩:ということで、
ほげ山くん:あ、
くれま先輩:うんうん。じゃあ、
<mt:If name="entry_template">
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a>
»
<mt:ParentCategories glue=" » ">
<a href="<mt:CategoryArchiveLink />"><mt:CategoryLabel /></a>
</mt:ParentCategories>
»
<mt:EntryTitle />
</p>
<!-- end div#topicPath --></div>
<mt:ElseIf name="page_template">
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » <mt:PageTitle />
</p>
<!-- end div#topicPath --></div>
<mt:ElseIf name="category_archive">
<div id="topicPath">
<mt:SetVarBlock name="arctitle"><mt:ArchiveTitle encode_html="1" /></mt:SetVarBlock>
<p>
<a href="<mt:BlogUrl />">トップ</a>
»
<mt:ParentCategories glue=" » ">
<mt:SetVarBlock name="catlabel"><mt:CategoryLabel encode_html="1" /></mt:SetVarBlock>
<mt:If name="catlabel" ne="$arctitle">
<a href="<mt:CategoryArchiveLink />"><mt:CategoryLabel encode_html="1" /></a>
<mt:Else>
<mt:CategoryLabel encode_html="1" />
</mt:If>
</mt:ParentCategories>
</p>
<!-- end div#topicPath --></div>
<mt:ElseIf name="search_results">
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » 「<mt:SearchString />」の検索結果</p>
<!-- end div#topicPath --></div>
<mt:Else>
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » サイトマップ</p>
<!-- end div#topicPath --></div>
</mt:If>
ほげ山くん:うーむ。mt:Ifの中に、
くれま先輩:mt:ElseIfの部分で、
ほげ山くん:なるほどなるほど、
- 【参考URL】
- Archive Template Variables | MovableType.
org (英語)
http://movabletype. org/ documentation/ designer/
archive-template-variables.html
くれま先輩:そうそう!
ほげ山くん:そして、
くれま先輩:そうだよねぇ。それを説明したいから、
- インデックステンプレート
- サイトマップ
- アーカイブテンプレート
- ウェブページ
- ブログ記事
- ブログ記事のリスト
- システムテンプレート
- 検索結果
<mt:Include module="パンくずナビゲーション" />を記述するテンプレート
ほげ山くん:はーい。あぁ、
くれま先輩:よくできました! 今回はそういうことなのでさっきみたいに書いたの。というか、
ほげ山くん:できました。パンくずナビゲーションの部分は、
ブログ記事
<div id="topicPath">
<p>
<a href="http://xxx.xxxxxx.xx/>トップ
</a> » <a
href="http://xxx.xxxxxx.xx/japan/">国内作家の絵本
</a> » トナカイさんの赤いおはな
</p>
<!-- end div#topicPath --></div>
ウェブページ
<div id="topicPath">
<p>
<a href="http://xxx.xxxxxx.xx/>トップ
</a> » 会社概要
</p>
<!-- end div#topicPath --></div>
ブログ記事のリスト
<div id="topicPath">
<p>
<a href="http://xxx.xxxxxx.xx/>トップ
</a> » 国内作家の絵本
</p>
<!-- end div#topicPath --></div>
検索結果
<div id="topicPath">
<p>
<a href="http://xxx.xxxxxx.xx/>トップ
</a> » 「(検索キーワード)」の検索結果
</p>
<!-- end div#topicPath --></div>
サイトマップ
<div id="topicPath">
<p>
<a href="http://xxx.xxxxxx.xx/>トップ
</a> » サイトマップ
</p>
<!-- end div#topicPath --></div>
くれま先輩:じゃ、
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a>
»
<mt:ParentCategories glue=" » ">
<a href="<mt:CategoryArchiveLink />"><mt:CategoryLabel /></a>
</mt:ParentCategories>
»
<mt:EntryTitle />
</p>
<!-- end div#topicPath --></div>
ほげ山くん:mt:ParentCategoriesって、
くれま先輩:当たり!
ほげ山くん:今後、
くれま先輩:ありえるよね。今後のことも考慮して、
ほげ山くん:なるほどー。
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » <mt:PageTitle />
</p>
<!-- end div#topicPath --></div>
くれま先輩:これは単純だよね。
ほげ山くん:mt:PageTitleで、
<div id="topicPath">
<mt:SetVarBlock name="arctitle"><mt:ArchiveTitle encode_html="1" /></mt:SetVarBlock>
<p>
<a href="<mt:BlogUrl />">トップ</a>
»
<mt:ParentCategories glue=" » ">
<mt:SetVarBlock name="catlabel"><mt:CategoryLabel encode_html="1" /></mt:SetVarBlock>
<mt:If name="catlabel" ne="$arctitle">
<a href="<mt:CategoryArchiveLink />"><mt:CategoryLabel encode_html="1" /></a>
<mt:Else>
<mt:CategoryLabel encode_html="1" />
</mt:If>
</mt:ParentCategories>
</p>
<!-- end div#topicPath --></div>
ほげ山くん:これにもmt:ParentCategoriesが使われてますけど…。なんだかmt:SetVarBlockで
くれま先輩:よく観察してますなー。よく見るとわかるけど、
ほげ山くん:えーっと。現在のカテゴリ名
くれま先輩:よくできました。何でこういうことをするかというと、
ほげ山くん:<a href="<mt:CategoryArchiveLink />"><mt:CategoryLabel encode_
くれま先輩:そうそう。でも、
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » 「<mt:SearchString />」の検索結果</p>
<!-- end div#topicPath --></div>
ほげ山くん:検索結果テンプレートの場合は、
くれま先輩:検索に使用された文字列を、
ほげ山くん:これって、
<div id="topicPath">
<p>
<a href="<mt:BlogUrl />">トップ</a> » サイトマップ</p>
<!-- end div#topicPath --></div>
くれま先輩:で、
ほげ山くん:今回のサイトでは、
くれま先輩:そんな訳で、