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

Possibility to prioritise main entities

brotkrueml opened this issue · comments

Is your feature request related to a problem? Please describe.

On a blog post, an Article type is used to describe the content of that page. On the same page there are FAQ questions/answers available. To have Google show these FAQ items as rich snippets on a search result page, the type of the page must be of FAQPage. Since some days, the Google Search Console displays an error, when other types than Question are added to a mainEntity property (here: Article).

The Article type is embedded by a view helper from a page template, whereas the Question types are embedded via PHP from the content element. So they don't "know" each other.

Describe the solution you'd like

I can think of two solutions:

  1. Possibility to reset the main entities. Then the already added main entity types are moved to the default types. This has the drawback that, for example, the first added type has priority, and will then removed from main entity which is not correct.
  2. Possibility to use a priority flag when adding a type as main entity. When at least one type with priority is available at rendering time the unprioritised types are moved to the default types.

For now, I tend to implement the second variant.

Tasks

  • Prioritising a main entity via API is available
  • Prioritising a main entity in a view helper is available
  • The documentation is adjusted.
  • A feature entry in the changelog is available.