brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup
https://extensions.typo3.org/extension/schema
GNU General Public License v2.0
32 stars 9 forks source link

Rich Snippet Tool interprets FAQPage in breadcrumb wrong #101

Closed brotkrueml closed 2 years ago

brotkrueml commented 2 years ago

When a page uses FAQPage as WebPage type then the FAQPage is also available in the breadcrumb as type for that page, e.g.:

{
    "@context": "https://schema.org/",
    "@graph": [
        {
            "@type": "FAQPage",
            "breadcrumb": {
                "@type": "BreadcrumbList",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "item": {
                            "@type": "WebPage",
                            "@id": "https://www.domain.de/1.php"
                        },
                        "name": "1",
                        "position": "1"
                    },
                    {
                        "@type": "ListItem",
                        "item": {
                            "@type": "WebPage",
                            "@id": "https://www.domain.de/1/2.php"
                        },
                        "name": "2",
                        "position": "2"
                    },
                    {
                        "@type": "ListItem",
                        "item": {
                            "@type": "FAQPage",
                            "@id": "https://www.domain.de/1/2/3.php"
                        },
                        "name": "3",
                        "position": "3"
                    }
                ]
            },
            "mainEntity": {
                "@type": "Question",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": "<p>...</p>"
                },
                "name": "What is the reason of life?"
            }
        }
    ]
}

Now the Rich Snippet Testing Tool complaints about this structure:

Field "mainEntity" is missing
Field "FAQPage" is double available

Appearently, the scope is not taken into the account.

As a quick fix, a possible subtype is removed from the breadcrumb and always WebPage used.

fnagel commented 2 years ago

Tested this in TYPO3 11.5.17 and now the Google tests are green again :-)

Thanks a lot!