MTBreadcrumbs
パンくずリストを生成するためのブロックタグです。例えば記事テンプレートで利用した場合、ウェブサイト→ブログ→カテゴリ→サブカテゴリ→記事の順に、アーカイブへのリンクとオブジェクト名をコンテキストにセットしてループ出力します。
使い方
<MTBreadcrumbs glue=">"> <a href="<$MTBreadcrumbsURL escape="html"$>"><$MTBreadcrumbsLabel escape="html"$></a> </MTBreadcrumbs> <MTIgnore>予約変数「__last__」を使用して、記事タイトルのみリンクを付与しない記述</MTIgnore> <MTBreadcrumbs glue=">"> <MTUnless name="__last__"> <a href="<$MTBreadcrumbsURL remove_html="1" escape="html">"> <$MTBreadcrumbsLabel remove_html="1" _default="No Label" escape="html"$> </a> <MTElse> <$MTBreadcrumbsLabel remove_html="1" _default="No Title" escape="html"$> </MTUnless> </MTBreadcrumbs> <MTIgnore>予約変数「__type__」を使用して、記事タイトルのみリンクを付与しない記述例1</MTIgnore> <MTBreadcrumbs glue=">"> <MTIf name="__type__" eq="blog"> <a href="<$MTBreadcrumbsURL remove_html="1" escape="html">"> <$MTBreadcrumbsLabel remove_html="1" _default="No Label" escape="html"$> </a> <MTElseIf eq="category"> <a href="<$MTBreadcrumbsURL remove_html="1" escape="html">"> <$MTBreadcrumbsLabel remove_html="1" _default="No Label" escape="html"$> </a> <MTElse> <$MTBreadcrumbsLabel remove_html="1" _default="No Title" escape="html"$> </MTIf> </MTBreadcrumbs> <MTIgnore>予約変数「__type__」を使用して、記事タイトルのみリンクを付与しない記述例2</MTIgnore> <MTBreadcrumbs glue=">"> <MTUnless name="__type__" eq="entry"> <a href="<$MTBreadcrumbsURL remove_html="1" escape="html">"> <$MTBreadcrumbsLabel remove_html="1" _default="No Label" escape="html"$> </a> <MTElse> <$MTBreadcrumbsLabel remove_html="1" _default="No Title" escape="html"$> </MTUnless> </MTBreadcrumbs>
モディファイア
- glue=">"
-
ループの出力の後に設定する区切り文字を指定します。区切り文字には ' (シングル・クォーテーション) や " (ダブル・クォーテーション) は使えません。