Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save About2git/11602fa7762b5c24aad9 to your computer and use it in GitHub Desktop.
Save About2git/11602fa7762b5c24aad9 to your computer and use it in GitHub Desktop.
Snippet for building a breadcrumb in www.getkirby.com with semantic markup (schema.org)
<div class="breadcrumb" itemprop="breadcrumb">
You are here:
<span prefix="v: http://rdf.data-vocabulary.org/#">
<?php foreach($site->breadcrumb() AS $crumb): ?>
<?php if ($crumb->isActive()): ?>
<span typeof="v:Breadcrumb">
<span class="breadcrumb_last" property="v:title">
<?php echo $crumb->title() ?>
</span>
</span>
<?php else: ?>
<span typeof="v:Breadcrumb">
<a href="<?php echo $crumb->url() ?>" rel="v:url" property="v:title">
<?php echo $crumb->title() ?>
</a>
</span> &rsaquo;
<?php endif ?>
<?php endforeach ?>
</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment