Skip to content

Commit

Permalink
Add microdata to breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels van der Veer (n9iels) committed Aug 2, 2015
1 parent be11290 commit 7d0844a
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions modules/mod_breadcrumbs/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

?>

<ul class="breadcrumb<?php echo $moduleclass_sfx; ?>">
<?php
if ($params->get('showHere', 1))
{
echo '<li class="active">' . JText::_('MOD_BREADCRUMBS_HERE') . '&#160;</li>';
}
else
{
echo '<li class="active"><span class="divider icon-location"></span></li>';
}
<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb<?php echo $moduleclass_sfx; ?>">
<?php if ($params->get('showHere', 1)) : ?>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="active">
<?php echo JText::_('MOD_BREADCRUMBS_HERE'); ?>&#160;
</li>
<?php else : ?>
<li class="active">
<span class="divider icon-location"></span>
</li>
<?php endif; ?>

<?php
// Get rid of duplicated entries on trail including home page when using multilanguage
for ($i = 0; $i < $count; $i++)
{
Expand All @@ -44,32 +44,34 @@

// Generate the trail
foreach ($list as $key => $item) :
if ($key != $last_item_key)
{
// Render all but last item - along with separator
echo '<li>';
if (!empty($item->link))
{
echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
}
else
{
echo '<span>' . $item->name . '</span>';
}
if ($key != $last_item_key) :
// Render all but last item - along with separator ?>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<?php if (!empty($item->link)) : ?>
<a itemprop="item" href="<?php echo $item->link; ?>" class="pathway">
<span itemprop="name">
<?php echo $item->name; ?>
</span>
</a>
<?php else : ?>
<span itemprop="name">
<?php $item->name; ?>
</span>
<?php endif; ?>

if (($key != $penult_item_key) || $show_last)
{
echo '<span class="divider">' . $separator . '</span>';
}

echo '</li>';
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<li class="active">';
echo '<span>' . $item->name . '</span>';
echo '</li>';
}
<?php if (($key != $penult_item_key) || $show_last) : ?>
<span class="divider">
<?php echo $separator; ?>
</span>
<?php endif; ?>
</li>
<?php elseif ($show_last) :
// Render last item if reqd. ?>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="active">
<span itemprop="name">
<?php echo $item->name; ?>
</span>
</li>
<?php endif;
endforeach; ?>
</ul>
</ol>

0 comments on commit 7d0844a

Please sign in to comment.