TYPO3 extension for handling Google structured data into your page.
- install the extension
- include static typoscript file (HD Structured data)
- go to edit page properties
- open tab "Structured data"
- add a new structured data item
Source: https://developers.google.com/search/docs/appearance/structured-data/article
Source: https://developers.google.com/search/docs/appearance/structured-data/faqpage
Source: https://developers.google.com/search/docs/appearance/structured-data/organization
Source: https://developers.google.com/search/docs/appearance/structured-data/video
Source: https://developers.google.com/search/docs/appearance/structured-data/review-snippet
Source: https://developers.google.com/search/docs/appearance/structured-data/product
Source: https://developers.google.com/search/docs/appearance/structured-data/event
Events should contain organizer. It's possible to attach already exiting organization over field "Pointer to already existing organizers" where is possible to choose different structured data entries, but only Organization type would be used in Frontend output.
First add a field into database and TCA
ext_tables.sql
CREATE TABLE tx_news_domain_model_news (
structured_data INT(11) DEFAULT 0 NOT NULL,
);
Configuration/TCA/Overrides/tx_news_domain_model_news.php
$tempColumns = [
'structured_data' => [
'label' => 'Structured data',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_hdstructureddata_domain_model_structureddata',
'foreign_field' => 'foreign_uid',
'foreign_sortby' => 'sorting',
'foreign_table_field' => 'tablename',
'foreign_match_fields' => [
'fieldname' => 'structured_data',
],
],
]
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("tx_news_domain_model_news", $tempColumns, 1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_news_domain_model_news',
'--div--;Structured Data, structured_data',
);
Then integrate the typoscript code.
TypoScript
[request && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0]
# this part is not needed if default typoscript is used
# page.headerData.90 = USER
# page.headerData.90.userFunc = Hyperdigital\HdStructureddata\UserFunctions\StructuredDataPrint->printTags
page.headerData.90 {
tableName = tx_news_domain_model_news
fieldName = structured_data
parentUid = GP:tx_news_pi1|news
}
[end]