On September 20, 2019, Google launched an automatic breadcrumbs check on sites that are registered with Google Search Console, sending out alerts to Rich Snippets for errors on the site - specifically Breadcrumbs.

According to the Google specification, the last item in the navigation must also contain information about the item:

  • @type
  • name
  • position
  • item @type
  • item @id

This requirement is not new (part of the Rich Snippets implementation since 2015), what is new is the deployment of automatic and programmatic checks from Google.

However, since all of our sites and e-shops regularly go through the review process before each launch, and one of the checks is the deployment of Rich Snippets, we have been modifying the Breadcrumbs module to meet these requirements since 2018.

How to implement a modification for the correct functionality of the module and successful evaluation by the Google Rich Snippets testing tool?

  1. Copy mod_breadcrumbs template to override template - eg templates / your_templates / html / mod_breadcrumbs
  2. Place module template in this folder - eg templates / your_templates / html / mod_breadcrumbs / default.php
  3. Edit PHP file and replace PHP code

 

Old:

		<?php elseif ($show_last) :
			// Render last item if reqd. ?>
			<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="active">
				<span itemprop="name">
					<?php echo $item->name; ?>
				</span>
				<meta itemprop="position" content="<?php echo $key + 1; ?>">
			</li>
		<?php endif;

New:

 

			<?php elseif ($show_last) :
				$uri = JFactory::getURI();
				$absolute_url = $uri->toString();
				// #11024 - 2018-12-04 - Fix Rich Snippets - Render last item if requirred - with link for Rich Snippets from Google !!!. ?>
				<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="active">
					<link itemprop="item" href="/<?php echo $absolute_url; ?>">
					<span itemprop="name"><?php echo $item->name; ?></span>
					<meta itemprop="position" content="<?php echo $key + 1; ?>">
				</li>
			<?php endif;