Skip to content

Instantly share code, notes, and snippets.

@snetty
Created December 12, 2013 13:40
Show Gist options
  • Save snetty/7928072 to your computer and use it in GitHub Desktop.
Save snetty/7928072 to your computer and use it in GitHub Desktop.
<? $parents = $this->page->navigation_parents(false); ?>
<div class="breadcrumbs hidden-print">
<div class="container">
<ol class="breadcrumb">
<? $why = array(); $home = CMS_Page::findByUrl('/', $why); ?>
<li><a href="<?= $home->url ?>"><?= $home->navigation_label() ?></a></li>
<? foreach ($parents as $parent) : ?>
<li><a href="<?= $parent->url ?>"><?= $parent->navigation_label() ?></a></li>
<? endforeach; ?>
<? $this->render_block('breadcrumb') ?>
<? if (!array_key_exists('breadcrumb', $this->_page_block_content)) : ?>
<li class="active"><?= $this->page->navigation_label() ? $this->page->navigation_label() : h($this->page->title) ?></li>
<? endif; ?>
</ol>
</div>
</div>
@snetty
Copy link
Author

snetty commented Jan 13, 2014

this gist autogenerates breadcrumbs for lemonstand based websites based on the Navigation tab in the CMS. It also allows you to override a page's breadcrumb via the page block section, just add a page block called "breadcrumb" and it'll insert that rather than the autogenerated one for that page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment