Last active
December 8, 2017 12:19
-
-
Save nyankichi-n-n/e80088fda9fce5032af6a0f51eb4a22e to your computer and use it in GitHub Desktop.
concrete5 Breadcrumb Trail Page Linksカスタマイズ
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 | |
use Concrete\Core\Multilingual\Page\Section\Section; | |
defined('C5_EXECUTE') or die("Access Denied.");?> | |
<?php $c = Page::getCurrentPage(); | |
$multilingualSection = Section::getBySectionOfSite($c); | |
if ($multilingualSection) { | |
if ($multilingualSection->getLocale() === 'en_US'){ | |
$homePageName = ' Home'; | |
$homePageLink = '英語のURL'; | |
} else { | |
$homePageName = ' ホーム'; | |
$homePageLink = '日本語のURL'; | |
} | |
} ?> | |
<div class="breadcrumb-trail"><a href="<?php echo $homePageLink;?>"><i class="fa fa-home"></i><?php echo $homePageName;?></a> | |
<?php | |
$sublevels = $this->controller->getSubLevels(); | |
if (!empty($sublevels)) { | |
foreach($sublevels as $p) { | |
echo '<span class="breadcrumb-trail-sub"> <span class="delim">'. h($delimiter) .'</span> '; | |
if ($p["link"] !== false) { | |
echo '<a href="'. $p["link"] .'">'; | |
} else { | |
echo '<strong>'; | |
} | |
echo $p["title"]; | |
if ($p["link"] !== false) { | |
echo '</a>'; | |
} else { | |
echo '</strong>'; | |
} | |
echo '</span>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment