WithCandour / statamic-aardvark-seo

Candour's SEO addon for Statamic
https://statamic.com/marketplace/addons/aardvark-seo
11 stars 18 forks source link

Breadcrumb Issue #68

Closed aerni closed 3 years ago

aerni commented 3 years ago

I'm getting a Google Search Console error concerning my website's Breadcrumbs. It's saying, that the item's name is missing. The error only occurs in a multi-site on a non-default locale.

// Default English Locale

{
  "@type": "BreadcrumbList",
  "itemListElement": [{ 
    "@type": "ListItem", 
    "position": 1,
    "item": {
      "@type": "Thing",
      "name":"Home",
      "id": "https:\/\/michaelaerni.ch\/en"
    }
  }]
}

// German Locale

{
  "@type": "BreadcrumbList",
  "itemListElement": [{ 
    "@type": "ListItem", 
    "position": 1,
    "item": {
      "@type": "Thing",
      "id": "https:\/\/michaelaerni.ch\/de"
    }
  }]
}

The name key is missing in the item object in the German locale.

AndrewHaine commented 3 years ago

Hi @aerni ,

I've just released 2.0.7 which should fix the issues we're having with multisite breadcrumbs :)

LorensoD commented 3 years ago

I'm still experiencing this issue

// Default English Locale: https://eventix.io/help/my-ticket-revenue

{
   "@type":"ListItem",
   "position":2,
   "item":{
      "@type":"Thing",
      "name":"Help",
      "id":"https:\/\/eventix.io\/help"
   }
}

// Dutch Locale: https://eventix.nl/help/wanneer-ontvang-ik-mijn-ticketomzet

{
   "@type":"ListItem",
   "position":2,
   "item":{
      "@type":"Thing",
      "id":"https:\/\/eventix.nl\/help"
   }
}

I'm on 2.0.11

AndrewHaine commented 3 years ago

Hey @LorensoD , I'm struggling to replicate this but do think it's something we should look into, please could you send over the markdown files for both language versions of the entry and a copy of your config/statamic/sites.php file, please attach them to an email to aardvarkseo@withcandour.co.uk, I'll drop them into a local site and take a look.

moritzlang commented 3 years ago

Hello @AndrewHaine,

what is the status on this issue?

I am experiencing the same behaviour for the structured breadcrumbs data. The problem is that the any synced fields (e.g. the title) are not part of the localized entry (Code).

A possible solution would be to get the title of the origin through $entry->origin()->title when no title is present on the localized entry.

AndrewHaine commented 3 years ago

HI @moritzlang ,

Brilliant thanks for the spot on this one, I've confirmed that that was the issue and fix on my local multisite setup and that's now been merged and released in 2.0.13. We're still ironing out some of the other multisite bugs and enhancements but hopefully will have more releases out over the next couple of weeks that address those bits.

@LorensoD When possible please could you let me know if this has fixed the issue with the breadcrumbs on your site too and I'll get this issue closed off.

Thanks, Andrew

moritzlang commented 3 years ago

@AndrewHaine Thank you for the fast fix!

LorensoD commented 3 years ago

@AndrewHaine I can confirm that this fixed the issue with the breadcrumbs on my site. @moritzlang Thanks for spotting the problem.