brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup

Home Page:https://extensions.typo3.org/extension/schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rich Snippet Tool interprets FAQPage in breadcrumb wrong

brotkrueml opened this issue · comments

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.

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

Thanks a lot!