Skip to content

Instantly share code, notes, and snippets.

@hissy
Forked from katzueno/gist:172a559fff4f20667c1b
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/8211ed84e3af80db7519 to your computer and use it in GitHub Desktop.
Save hissy/8211ed84e3af80db7519 to your computer and use it in GitHub Desktop.
<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 = krsort($nh->getTrailToCollection($c));
if (count($trail) > 2) {
echo . ' - ' .h($trail[2]);
}
}
?></h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment