Created
April 14, 2013 09:17
-
-
Save hissy/5382055 to your computer and use it in GitHub Desktop.
#concrete5 テーマ・テンプレートから、現在見ているページの親ページのリンクを表示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$th = Loader::helper('text'); | |
$nh = Loader::helper('navigation'); | |
$page = Page::getCurrentPage(); | |
$parent = Page::getByID($page->getCollectionParentID()); | |
// $parent = Page::getByPath("/example"); // パス決め打ちで取得したい場合 | |
if(is_object($parent)){ | |
$parentLink = $nh->getCollectionURL($parent); | |
?> | |
<a href="<?php echo $parentLink?>">Back to <?php echo $th->entities($parent->getCollectionName())?></a> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment