News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

breadcrumb ListItem does not show the product URL - link

Started by Digi-web, August 29, 2018, 12:50:47 PM

Previous topic - Next topic

Digi-web

Hello,

i think i figured an issue from Google https://search.google.com/structured-data/testing-tool
The last item (product) is missing the item value ( URL ) when we are on a virtuemart product page.

Google reports:
itemListElement   
@type   
ListItem
name   
ItemName
position   
5
litem   
A value for the item field is required

i performed a var_dump($item); in 

modules\mod_breadcrumbs\tmpl\default.php:67:
object(stdClass)[1299]
  public 'name' => string 'XXX name' (length=54)
  public 'link' => string '' (length=0)


A relative posts is this one (other issue thought):
https://forum.virtuemart.net/index.php?topic=139906.msg491659#msg491659

Is there an option for that i am missing perhaps?

info:
Use full category tree for product links enabled
Virtuemart - joomla latest.
Tested on both localhost and live servers.

BR,
Alexander
Custom Joomla - Virtuemart Development and Templates
Website: http://www.digi-web.gr

StefanSTS

Hello Alexander,

the structured data is given by the sublayout snippet.php. Maybe you like to add the the property "url" there?

Regards
Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

jjk

I can reproduce that. But Google's Structured Data Testing Tool throws an error only if the Joomla breadcrumbs are enabled. (I don't use it on my live site). Without the breadcrumbs module enabled, the test tool shows no error.

If I understand it correctly, Google expects the URL to the webpage that represents the breadcrumb as the value of 'item'.

Update:
Just tested a replacement for the Joomla breadcrumbs module. In my test case, the Google 'Structured Data Test Tool' shows no error after I replaced the original Joomla breadcrumbs module with this one:
https://extensions.joomla.org/extension/microdata-google-breadcrumbs/
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Digi-web

Yes jjk, this is the case only with the module you fan see this error.
Hmm sinxe the error does not appear with the ither breadcumb  perhaps it is not a vm issue ... but perhaps the devs there have made a custom query os such .. cannot be sure .

I will further test when i have time . Surelley it must be addressed by either vm or joomla devs.

Br
Custom Joomla - Virtuemart Development and Templates
Website: http://www.digi-web.gr

Digi-web

Hello again, long time no see.
I guess you have noticed the google update informing about this issue (Missing field 'item' eg: https://support.google.com/webmasters/thread/14845432?hl=en).

I can confirm the module does not have this error, at least it is a temporary workaround...

I am not sure if it is a virtuemart or Joomla issue after all.
Custom Joomla - Virtuemart Development and Templates
Website: http://www.digi-web.gr

StefanSTS

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Studio 42


StefanSTS

Studio, your snippet does not give a consistent structure, see the first screenshot.

I posted two default.php files for mod_breadcrumbs' default.php in the Joomla forum, that produce the same structure for all list items like in the second screenshot.
https://forum.joomla.org/viewtopic.php?f=712&t=974526&p=3581290#p3581290

The second default.php has the option to show the last current item as a link, which is not wanted mostly, but some might want that.

Regards
Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Studio 42

Google validated the snippet. But you are right, the item need to be inside the listItem
This code is right and dont need a link:
        $uri = JFactory::getURI();
         $absolute_url = $uri->toString();
         // Render last item if reqd. ?>
         <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="active">
            <span itemprop="item" content="<?php echo $absolute_url?>">
               <span itemprop="name">
                  <?php echo $item->name?>
               </span>
            </span>
            <meta itemprop="position" content="<?php echo $key 1?>">
         </li>