clickstorm / cs_seo

[clickstorm] SEO
Other
33 stars 49 forks source link

Breadcrumb is empty on treeLevel 0 #236

Closed kraemer-igroup closed 5 years ago

kraemer-igroup commented 5 years ago

Googles testing tool for structured data (https://search.google.com/structured-data/testing-tool) gives an error on the "root" page because "itemListElement" is empty. I think the output of an empty breadcrump should be omitted.

My suggestion would be to add a typoscript condition "[tree.level > 0]" within "Configuration/TypoScript/Setup/structuredData.typoscript" around "page.footerData.656".

Or you could add a condition if (count($rootline) < 2) { return ''; } in "Classes/UserFunc/StructuredData.php" after line 117.

mhirdes commented 5 years ago

Hey, bugfix is online. Feel free to test.