Skip to content

Instantly share code, notes, and snippets.

@katzueno
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save katzueno/172a559fff4f20667c1b to your computer and use it in GitHub Desktop.
Save katzueno/172a559fff4f20667c1b to your computer and use it in GitHub Desktop.
concrete5 第4階層以降であれば、第3階層 のページタイトルを表示させる。
<h1><?php
$c = Page::getCurrentPage();
$nh = Loader::helper('navigation');
// concrete5 第4階層以降であれば、第3階層 のページタイトルを表示させる。
// [現在のページタイトル] - [第3階層のページタイトル]
// ページ属性 display_secondary_title がチェックされていれば第3階層のタイトルを表示しない
// $trail [0] はトップ
// $trail [1] は第2階層
echo h($c->getCollectionName());
if (!$c->getAttribute('display_secondary_title')){
$trail = $nh->getTrailToCollection($c))
$breadcrumb = array_reverse ($trail);
if ($$breadcrumb[2]) {
echo . ' - ' .h($breadcrumb[2]->getCollectionName());
}
}
?></h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment