Skip to content

Instantly share code, notes, and snippets.

@katzueno
Created May 26, 2015 03:08
Show Gist options
  • Save katzueno/9835751727f2df3c2803 to your computer and use it in GitHub Desktop.
Save katzueno/9835751727f2df3c2803 to your computer and use it in GitHub Desktop.
Original Breadcramp.php
<?php defined('C5_EXECUTE') or die("Access Denied.");
$navItems = $controller->getNavItems(true); // Ignore exclude from nav
$c = Page::getCurrentPage();
if (count($navItems) > 0) {
echo '<nav role="navigation" aria-label="breadcrumb">'; //opens the top-level menu
echo '<ol class="breadcrumb">';
foreach ($navItems as $ni) {
if ($ni->isCurrent) {
echo '<li class="active">' . $ni->name . '</li>';
} else {
echo '<li><a href="' . $ni->url . '" target="' . $ni->target . '">' . $ni->name . '</a></li>';
}
}
echo '</ol>';
echo '</nav>'; //closes the top-level menu
} else if (is_object($c) && $c->isEditMode()) { ?>
<div class="ccm-edit-mode-disabled-item"><?php echo t('Empty Auto-Nav Block.')?></div>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment