Call Us: 512.271.5221

23
September
2019

Fix Breadcrumbs Markup on Joomla site

You may have noticed that Google Search Console recently added a New Structured Data Report for Breadcrumbs in order to allow users to evaluate whether their breadcrumb markup has been implemented correctly.

 

Twitter lit up with posts and pictures like this one: 

 

The default Joomla breadcrumbs do not put a link on the last breadcrumb, and that is causing the validation issue. The dilemma is that you do not want a link that simply goes to itself or that confuses users.

 

The solution is to go to template code and make an override for mod_breadcrumbs
You can accomplish this in less than 5 minutes by following the video at the bottom

 

Around line 56, find

<?php if (($key !== $penult_item_key) || $show_last) : ?>
      <span class="divider">
          <?php echo $separator; ?>
      </span>
<?php endif; ?>

And replace with

<?php if (($key !== $penult_item_key) || $show_last) : ?>
     <link  href="/<?php echo $item->link; ?>">
      <span class="divider">
          <?php echo $separator; ?>
      </span>
<?php endif; ?>

 

Around line 65, find

<li  itemscope itemtype="https://schema.org/ListItem" class="active">
        <span itemprop="name">
      <?php echo $item->name; ?>
        </span>
        <meta  content="<?php echo $key + 1; ?>">
</li>

And replace with

<li  itemscope itemtype="https://schema.org/ListItem" class="active">
<link  href="/<?php echo $item->link; ?>">
        <span itemprop="name">
      <?php echo $item->name; ?>
        </span>
        <meta  content="<?php echo $key + 1; ?>">
</li>

Here is a short video of how to create the template overrides:

Categories: Error Fixes

Get Started with YellowWebMonkey

Invalid Input

Invalid Input

Invalid Input

Joomla Certified Administrator