Problem/Motivation
Current output of the breadcrumb list:
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"@id": "[Insert URL of page 1]",
"name": "[Insert name of page 1]"
}, {
"@type": "ListItem",
"position": 2,
"@id": "[Insert URL of page 1]",
"name": "[Insert name of page 1]"
}]
Steps to reproduce
Expected output of the breadcrumb list:
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "[Insert URL of page 1]",
"name": "[Insert name of page 1]"
}
}, {
"@type": "ListItem",
"position": 2,
"item": {
"@id": "[Insert URL of page 2]",
"name": "[Insert name of page 2]"
}
}]
Proposed resolution
Update the BreadcrumbList property type as per the required structure
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
ankit agrawal commentedCreated the patch for the required breadcrumb structure.
Comment #3
ankit agrawal commentedComment #4
darvanenConfirmed the schema.org spec requires this layout.
Code is clean, does what is required by the IS (tested manually, now installed on a site).
Calling this RTBC, thanks @Ankit Agrawal.
Comment #5
damienmckennaComment #6
damienmckennaShouldn't it be like this?
Comment #7
darvanenYes. You are absolutely correct, sorry I didn't see the duplication, that's what I get for doing a review during crunch time :/
This new patch is good.
For anyone after the source of the information driving this change request it's here: https://schema.org/BreadcrumbList under the JSON-LD tab at the bottom of the page.
Comment #8
darvanenNope, I failed to re-save content when testing. #6 clears out the breadcrumb array because of the url key that \Drupal\schema_metatag\Plugin\schema_metatag\PropertyType\ItemListElement::outputValue is looking for.
Work in progress.
Comment #9
darvanenAccording to the google developer docs there are two ways to specify items: https://developers.google.com/search/docs/appearance/structured-data/bre...
One of which we already use. I'm starting to think this is a non-issue and I'm very tempted to close as 'works as designed'.
Comment #10
darvanenYeah I think "works as designed" is the best course of action.
If you're reading this and you disagree please feel free to reopen the ticket with an explanation as to why.