diff --git a/CHANGELOG.md b/CHANGELOG.md index 43836931..f527e281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ We will follow [Semantic Versioning](http://semver.org/). ### Fixed - Missing label of the tx_yoastseo_prominent_word table - Removed exclude=true from tx_yoastseo_prominent_word fields, table already has hideTable +- Use `websiteTitle` of site configuration within snippet preview, previously this was only taken from site languages instead of the site itself ### Changed - Updated mentions of the premium extension within the documentation diff --git a/Classes/Frontend/AdditionalPreviewData.php b/Classes/Frontend/AdditionalPreviewData.php index e756ec43..56c021ec 100644 --- a/Classes/Frontend/AdditionalPreviewData.php +++ b/Classes/Frontend/AdditionalPreviewData.php @@ -5,6 +5,7 @@ namespace YoastSeoForTypo3\YoastSeo\Frontend; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Core\Site\Entity\Site; use TYPO3\CMS\Core\Site\Entity\SiteLanguage; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; @@ -38,6 +39,10 @@ protected function getWebsiteTitle(): string if ($language instanceof SiteLanguage && !empty($language->getWebsiteTitle())) { return trim($language->getWebsiteTitle()); } + $site = $request->getAttribute('site'); + if ($site instanceof Site && !empty($site->getConfiguration()['websiteTitle'] ?? '')) { + return trim($site->getConfiguration()['websiteTitle']); + } if (!empty($GLOBALS['TSFE']->tmpl->setup['sitetitle'] ?? '')) { return trim($GLOBALS['TSFE']->tmpl->setup['sitetitle']);