Skip to content

Instantly share code, notes, and snippets.

@nyankichi-n-n

nyankichi-n-n/view.php

Last active Dec 8, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.