【MovableType覚書】テンプレート等の判別に利用される予約変数
2025.01.29MovableType
テンプレート等の判別に利用される予約変数
共通テンプレート
メインページ
main_index
ウェブページ
ウェブページ
page_archive
記事
記事
entry_archive
カテゴリ別記事リスト
カテゴリ別記事リスト
category_archive
コンテンツタイプ
アーカイブテンプレートで設定される変数
コンテンツタイプのアーカイブテンプレートで設定される変数
contenttype_archive
コンテンツタイプのリストテンプレートで設定される変数
contenttype_archive_listing
archive_classに設定される変数
全てのアーカイブテンプレートには、archive_class という変数が設定され、コンテンツタイプには以下が代入されます。
アーカイブテンプレート
コンテンツタイプ
contenttype-archive
contenttype-archive
出力するアーカイブタイプ
日別
contenttype-daily-archive
週別
contenttype-weekly-archive
月別
contenttype-daily-archive
週別
contenttype-weekly-archive
月別
contenttype-monthly-archive
年別
contenttype-yearly-archive
カテゴリ
contenttype-category-archive
カテゴリ-日別
contenttype-category-daily-archive
カテゴリ-月別
contenttype-category-monthly-archive
カテゴリ-週別
contenttype-category-weekly-archive
カテゴリ-年別
contenttype-category-yearly-archive
ユーザー別
contenttype-author-archive
ユーザー別-日別
contenttype-author-daily-archive
ユーザー別-月別
contenttype-author-monthly-archive
ユーザー別-週別
contenttype-author-weekly-archive
contenttype-yearly-archive
カテゴリ
contenttype-category-archive
カテゴリ-日別
contenttype-category-daily-archive
カテゴリ-月別
contenttype-category-monthly-archive
カテゴリ-週別
contenttype-category-weekly-archive
カテゴリ-年別
contenttype-category-yearly-archive
ユーザー別
contenttype-author-archive
ユーザー別-日別
contenttype-author-daily-archive
ユーザー別-月別
contenttype-author-monthly-archive
ユーザー別-週別
contenttype-author-weekly-archive
ユーザー別-年別
contenttype-author-yearly-archive
contenttype-author-yearly-archive
判別用テンプレート(途中です)
<mt:IfWebsite><mt:Ignore> ===== 親サイト ===== </mt:Ignore>
<mt:If name="main_index"><mt:Ignore> ===== 親サイトのメインページ ===== </mt:Ignore>
...
<mt:Elseif name="page_archive"><mt:Ignore> ===== 親サイトのウェブページ ===== </mt:Ignore>
...
<mt:Elseif name="entry_archive"><mt:Ignore> ===== 親サイトの記事 ===== </mt:Ignore>
...
<mt:Elseif name="category_archive"><mt:Ignore> ===== 親サイトのカテゴリアーカイブ ===== </mt:Ignore>
...
<mt:Else><mt:Ignore> ===== 親サイトの上記以外のテンプレート ===== </mt:Ignore>
...
</mt:If>
<mt:Else><mt:Ignore> ===== 子サイト ===== </mt:Ignore>
<mt:If name="main_index"><mt:Ignore> ===== 子サイトのメインページ ===== </mt:Ignore>
...
<mt:Elseif name="page_archive"><mt:Ignore> ===== 子サイトのウェブページ ===== </mt:Ignore>
...
<mt:Elseif name="entry_archive"><mt:Ignore> ===== 子サイトの記事 ===== </mt:Ignore>
...
<mt:Elseif name="category_archive"><mt:Ignore> ===== 子サイトのカテゴリアーカイブ ===== </mt:Ignore>
...
<mt:Else><mt:Ignore> ===== 子サイトの上記以外のテンプレート ===== </mt:Ignore>
...
</mt:If>
</mt:IfWebsite>