From 4768272704b0ae9b0db93eb715f646375a29d8fd Mon Sep 17 00:00:00 2001 From: Alex Bachynskyi Date: Fri, 27 Oct 2017 12:15:43 +0300 Subject: [PATCH] [FEATURE] add possibility to avoid same domain checking --- Classes/Controller/SitemapController.php | 2 +- Configuration/TypoScript/constants.txt | 3 +++ Configuration/TypoScript/setup.txt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/SitemapController.php b/Classes/Controller/SitemapController.php index dccc41f..91f7751 100644 --- a/Classes/Controller/SitemapController.php +++ b/Classes/Controller/SitemapController.php @@ -152,7 +152,7 @@ public function renderXMLSitemap($content, $configuration) { // creating the XML output foreach ($this->usedUrls as $urlData) { // skip pages that are not on the same domain - if (stripos($urlData['url'], $this->currentHostName) === FALSE) { + if (stripos($urlData['url'], $this->currentHostName) === FALSE && !$this->sitemapConfiguration['ignoreSameDomainCheck']) { continue; } if ($urlData['lastmod']) { diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt index 600d688..574ddc6 100644 --- a/Configuration/TypoScript/constants.txt +++ b/Configuration/TypoScript/constants.txt @@ -14,4 +14,7 @@ plugin.tx_seo { # cat=plugin.seo/string; type=boolean; label= Enable the canonical tag: Adds a new tag for showing the unique URL for this page. enableCanonicalTag = 1 + + # cat=plugin.seo/string; type=boolean; label= Ignore same domain check for sitemap.xml generator (can be used for sites that uses separate domains for localization). + ignoreSameDomainCheck = 0 } diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt index fab06bc..d66cc4c 100644 --- a/Configuration/TypoScript/setup.txt +++ b/Configuration/TypoScript/setup.txt @@ -98,4 +98,5 @@ tx_seo_xmlsitemaps { 10 = USER 10.userFunc = B13\SeoBasics\Controller\SitemapController->renderXMLSitemap 10.resolveMainShortcut = 1 + 10.ignoreSameDomainCheck = {$plugin.tx_seo.ignoreSameDomainCheck} }