? ? Maintainers Checked Pending

User tests: Successful: Unsuccessful:

avatar crystalenka
crystalenka
27 Apr 2022

This PR fixes structured data errors that made Google flag breadcrumbs as invalid.

When a breadcrumb item was a menu heading, instead of a link, Google would flag it as an invalid breadcrumb because it did not have a link. This is fixed by removing the JSON markup for items without a link, with the exception of the last item/current page.

This pull request fixes issues #37508 and #37510.

Basically reproducing my changes from my prior 4.0 pull request, but updated for the new JSON format.

Summary of Changes

  1. Added a check if a link exists in a breadcrumb item. If not, skip it and don't add it to the JSON.
  2. Added the last item (aka current page) to the JSON without a link. This is valid per Google SEO guidelines; they will pull the current page URL for the last item.

Testing Instructions

Create a site menu with a menu heading and subpages, like so:

  • Home
  • Menu Heading
    • Subpage 1

Create a breadcrumbs module. Ensure the module is published and visible on Subpage 1.

Navigate to subpage 1.

If this site is accessible over the internet:

Copy the URL and paste it into the field here: https://search.google.com/test/rich-results

If this site is hosted locally:

View source of Subpage 1 and copy it into the code box on https://search.google.com/test/rich-results
(Alternatively, you can find the generated JSON for the module and just copy that into the code box.)

Actual result BEFORE applying this Pull Request

Google detects the breadcrumbs but shows an error complaining about the missing URL in an item.

Expected result AFTER applying this Pull Request

Google correctly detects the breadcrumbs and marks them as valid.

Documentation Changes Required

None as far as I am aware.

Additional Notes

I intentionally am not checking if the module is set to display the last item or not because for the purposes of the JSON, it is better to include it and does not affect the front end display of the module.

avatar crystalenka crystalenka - open - 27 Apr 2022
avatar crystalenka crystalenka - change - 27 Apr 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2022
Category Modules Front End
avatar crystalenka crystalenka - change - 27 Apr 2022
Labels Added: ?
avatar nadjak77
nadjak77 - comment - 29 Apr 2022

I have tested this item ? unsuccessfully on f034a3c

I still get the error "Field itemListElement missing"


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar nadjak77 nadjak77 - test_item - 29 Apr 2022 - Tested unsuccessfully
avatar crystalenka
crystalenka - comment - 29 Apr 2022

Hmmm I will take a look again, maybe I missed something.

On Apr 29, 2022, at 4:28 PM, nadjak77 @.***> wrote:


I have tested this item ? unsuccessfully on f034a3c

I still get the error "Field itemListElement missing"

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.

avatar crystalenka
crystalenka - comment - 2 May 2022

I have tested this item ? unsuccessfully on f034a3cI still get the error "Field itemListElement missing"

I just tested on a clean install of 4.1 with Cassiopeia template and the blog sample data. No errors for me: https://search.google.com/test/rich-results/result?id=JGXsLee4zFK1Py_gDrovhg

@nadjak77 Can you please share your rich test results link with me by hitting the "share" button so I can debug?

Screen Shot 2022-05-02 at 17 02 41

I'm not sure how you could have gotten different results, unless maybe you have a template override on the breadcrumbs?

Thanks!

avatar nikosdion
nikosdion - comment - 2 May 2022

I have tested this item ? unsuccessfully on c69c933

I also get the “Missing field "itemListElement"” error at https://search.google.com/test/rich-results/result/r%2Fbreadcrumbs?id=iPMy7EevFSOnJtC0n2iV5g for my test page https://nikosdiontest.joomla.com/index.php/sample-layouts/blog

However, this appears to come not from the LD-JSON microdata but from the leftover Schema.org microdata on the breadcrumbs' <ol> tag:

<ol itemscope itemtype="https://schema.org/BreadcrumbList" class="mod-breadcrumbs breadcrumb px-3 py-2">

Since we're adding LD-JSON shouldn't we remove the Schema.org microdata altogether?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar nikosdion nikosdion - test_item - 2 May 2022 - Tested unsuccessfully
avatar crystalenka
crystalenka - comment - 3 May 2022

Since we're adding LD-JSON shouldn't we remove the Schema.org microdata altogether?

Yup. I missed that, must be remnant from the original conversion to JSON instead of micro data.

avatar nikosdion
nikosdion - comment - 3 May 2022

I have tested this item successfully on f0f4c76

I can confirm that now it works as described. There are no more breadcrumb microdata errors for the same page I tested before.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar nikosdion nikosdion - test_item - 3 May 2022 - Tested successfully
avatar richard67
richard67 - comment - 3 May 2022

@nadjak77 Could you test again with the latest changes? Thanks in advance.

avatar richard67
richard67 - comment - 3 May 2022

@aint-broke Please test if this PR solves your issue #37510 . Thanks in advance.

avatar nadjak77
nadjak77 - comment - 4 May 2022

I have tested this item successfully on f0f4c76

tested successfully. Thank you


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar nadjak77 nadjak77 - test_item - 4 May 2022 - Tested successfully
avatar nadjak77
nadjak77 - comment - 4 May 2022

@crystalenka Sorry for my late reply.
My first test (unsuccessfully) was on a clean new website without any other installations. The installation was on localhost.
But now the test was successfull. Thank you.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar alikon alikon - change - 4 May 2022
Status Pending Ready to Commit
avatar alikon
alikon - comment - 4 May 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37679.

avatar crystalenka
crystalenka - comment - 4 May 2022

No problem, @nadjak77 !! We got it figured out!

avatar laoneo laoneo - change - 13 May 2022
Labels Added: ? Maintainers Checked
avatar laoneo laoneo - change - 13 May 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-05-13 11:27:43
Closed_By laoneo
avatar laoneo laoneo - close - 13 May 2022
avatar laoneo laoneo - merge - 13 May 2022
avatar laoneo
laoneo - comment - 13 May 2022

Thanks!

Add a Comment

Login with GitHub to post a comment