nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
165 stars 70 forks source link

Breadcrumbs don't render in multi site setup #228

Closed goemaeret closed 6 years ago

goemaeret commented 6 years ago

Hello,

I have a Craftcms3 project with a multiple sites setup like this (they are all in the same single group):

schermafbeelding 2018-09-20 om 08 13 30

Problem is that the function seomatic.jsonLd.get('breadcrumbList') only returns a single list item 'home' on every page.

Am I missing something? Some sort of setting that needs to be enabled/disabled to maken the breadcrumbs work correctly in a multi site environment?

Thanks in advance, Thomas

khalwat commented 6 years ago

The way it builds the automatic breadcrumbs is it looks for elements that match the current route, and builds them from that. For instance, on this page:

https://nystudio107.com/blog/using-vuejs-graphql-to-make-practical-magic

We get these breadcrumbs:

{
  "@context": "http:\/\/schema.org",
  "@type": "BreadcrumbList",
  "description": "Breadcrumbs list",
  "itemListElement": [
    {
      "@type": "ListItem",
      "item": {
        "@id": "https:\/\/nystudio107.com\/",
        "name": "Homepage"
      },
      "position": 1
    },
    {
      "@type": "ListItem",
      "item": {
        "@id": "https:\/\/nystudio107.com\/blog",
        "name": "Blog Index"
      },
      "position": 2
    },
    {
      "@type": "ListItem",
      "item": {
        "@id": "https:\/\/nystudio107.com\/blog\/using-vuejs-graphql-to-make-practical-magic",
        "name": "Using VueJS + GraphQL to make Practical Magic"
      },
      "position": 3
    }
  ],
  "name": "Breadcrumbs"
}

It is possible you're using some kind of custom routing or such?

khalwat commented 6 years ago

@goemaeret ?