From f0c7631a759208af65961accd1cf4ae0ff2a7100 Mon Sep 17 00:00:00 2001 From: Riny van Tiggelen Date: Wed, 23 Oct 2024 20:44:57 +0200 Subject: [PATCH 1/3] [BUGFIX] Renamed JavascriptModules.php to JavaScriptModules.php --- CHANGELOG.md | 5 +++++ .../{JavascriptModules.php => JavaScriptModules.php} | 0 2 files changed, 5 insertions(+) rename Configuration/{JavascriptModules.php => JavaScriptModules.php} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 852731f9..e7b5c491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This changelog is according to [Keep a Changelog](http://keepachangelog.com). All notable changes to this project will be documented in this file. We will follow [Semantic Versioning](http://semver.org/). +## UNRELEASED + +### Fixed +- Renamed `JavascriptModules.php` to `JavaScriptModules.php` + ## 10.0.0 October 15, 2024 ### Breaking - Dropped support for TYPO3 10 diff --git a/Configuration/JavascriptModules.php b/Configuration/JavaScriptModules.php similarity index 100% rename from Configuration/JavascriptModules.php rename to Configuration/JavaScriptModules.php From fae1d8a1bb860ef465dd2924ecf6d00331f44c36 Mon Sep 17 00:00:00 2001 From: Riny van Tiggelen Date: Wed, 23 Oct 2024 20:46:28 +0200 Subject: [PATCH 2/3] [BUGFIX] Removed the premium support mention within the documentation --- CHANGELOG.md | 6 ++++-- Documentation/Index.rst | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b5c491..e5ff3c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,13 @@ This changelog is according to [Keep a Changelog](http://keepachangelog.com). All notable changes to this project will be documented in this file. We will follow [Semantic Versioning](http://semver.org/). -## UNRELEASED - +## UNRELEASED ### Fixed - Renamed `JavascriptModules.php` to `JavaScriptModules.php` +### Changed +- Removed the premium support mention within the documentation + ## 10.0.0 October 15, 2024 ### Breaking - Dropped support for TYPO3 10 diff --git a/Documentation/Index.rst b/Documentation/Index.rst index 324a335f..2154f0e1 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -59,10 +59,7 @@ and help editors write high quality content. .. tip:: Community support is available in the TYPO3 Slack channel - `#yoast-seo-for-typo3 `__. If you - want support for your installation, you can buy our - `premium plugin `__ and get 24/7 - support. + `#yoast-seo-for-typo3 `__. .. note:: From 358dd14cdabb44401ef04dc9408fe8656e0fb226 Mon Sep 17 00:00:00 2001 From: Riny van Tiggelen Date: Wed, 23 Oct 2024 21:09:31 +0200 Subject: [PATCH 3/3] [FEATURE] Added TypoScriptStructuredDataProvider to add structured data based on typoscript (premium functionality) --- CHANGELOG.md | 3 ++ .../TypoScriptStructuredDataProvider.php | 54 +++++++++++++++++++ .../TypoScript/Setup/Config.typoscript | 5 ++ 3 files changed, 62 insertions(+) create mode 100644 Classes/StructuredData/TypoScriptStructuredDataProvider.php diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ff3c4f..af623d42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. We will follow [Semantic Versioning](http://semver.org/). ## UNRELEASED +### Added +- `TypoScriptStructuredDataProvider` to add structured data to the page, configured with TypoScript (premium functionality) + ### Fixed - Renamed `JavascriptModules.php` to `JavaScriptModules.php` diff --git a/Classes/StructuredData/TypoScriptStructuredDataProvider.php b/Classes/StructuredData/TypoScriptStructuredDataProvider.php new file mode 100644 index 00000000..7dc13a8b --- /dev/null +++ b/Classes/StructuredData/TypoScriptStructuredDataProvider.php @@ -0,0 +1,54 @@ +> + */ + public function getData(): array + { + $data = []; + + foreach ( + $this->getTyposcriptFrontendController()->config['config']['structuredData.']['data.'] ?? [] as $dataConfig + ) { + if (array_key_exists('type', $dataConfig) && array_key_exists('context', $dataConfig)) { + $item = []; + $config = $this->typoScriptService->convertTypoScriptArrayToPlainArray($dataConfig); + + foreach ($config as $key => $value) { + $cObject = $key . '.'; + if (isset($dataConfig[$cObject])) { + $value = $this->getTyposcriptFrontendController()->cObj->stdWrap($key, $dataConfig[$cObject]); + } + $key = in_array($key, ['type', 'context']) ? '@' . $key : $key; + + $item[$key] = $value; + } + $data[] = $item; + } + } + + return (array)$data; + } + + protected function getTyposcriptFrontendController(): TypoScriptFrontendController + { + return $GLOBALS['TSFE']; + } +} diff --git a/Configuration/TypoScript/Setup/Config.typoscript b/Configuration/TypoScript/Setup/Config.typoscript index 6be0fc2f..f52d2f51 100644 --- a/Configuration/TypoScript/Setup/Config.typoscript +++ b/Configuration/TypoScript/Setup/Config.typoscript @@ -10,6 +10,11 @@ config { site { provider = YoastSeoForTypo3\YoastSeo\StructuredData\SiteStructuredDataProvider } + + typoscript { + provider = YoastSeoForTypo3\YoastSeo\StructuredData\TypoScriptStructuredDataProvider + after = breadcrumb + } } pageTitleProviders { yoastRecord {