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

Ankit Agrawal created an issue. See original summary.

ankit agrawal’s picture

StatusFileSize
new596 bytes

Created the patch for the required breadcrumb structure.

ankit agrawal’s picture

Status: Active » Needs review
darvanen’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed 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.

damienmckenna’s picture

Version: 8.x-2.1 » 8.x-2.x-dev
Assigned: ankit agrawal » Unassigned
Parent issue: » #3325539: Plan for Schema.org Metatag 8.x-2.5
damienmckenna’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new707 bytes

Shouldn't it be like this?

darvanen’s picture

Status: Needs review » Reviewed & tested by the community

Yes. 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.

darvanen’s picture

Assigned: Unassigned » darvanen
Status: Reviewed & tested by the community » Needs work

Nope, 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.

darvanen’s picture

According 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'.

darvanen’s picture

Status: Needs work » Closed (works as designed)

Yeah 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.