Skip to content

Instantly share code, notes, and snippets.

@nyankichi-n-n
Last active December 8, 2017 12:19
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 nyankichi-n-n/e80088fda9fce5032af6a0f51eb4a22e to your computer and use it in GitHub Desktop.
Save nyankichi-n-n/e80088fda9fce5032af6a0f51eb4a22e to your computer and use it in GitHub Desktop.
concrete5 Breadcrumb Trail Page Linksカスタマイズ
<?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