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

Type with only empty properties should be rendered

brotkrueml opened this issue · comments

A type without one property set is not rendered in the schema markup. But this is necessary, e.g. for the WebPage type of the home page, because no breadcrumb is available here.

Example:

$schemaManager = GeneralUtility::makeInstance(SchemaManager::class);
$schemaManager->addType(new WebPage());
$schemaManager->renderJsonLd();

The current output is:

<script type="application/ld+json">[]</script>

It should be:

<script type="application/ld+json">{"@context": "http://schema.org", "@type": "WebPage"}</script>