From 5358b7f9146ee0b192b0dee39fba347e6654f517 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Fri, 3 Sep 2021 07:27:54 +0200 Subject: [PATCH] Streamline routing parameter name Use category_id instead of category. TYPO3 forces sitemap but we use an uid and therefore should use category_id beside existing topic_id. --- Classes/Frontend/RssFeed/SitemapDataProvider.php | 2 +- Configuration/TypoScript/Setup/RssFeed.typoscript | 6 +++--- Resources/Private/Templates/Sitemaps/RssFeed.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Frontend/RssFeed/SitemapDataProvider.php b/Classes/Frontend/RssFeed/SitemapDataProvider.php index 8b1c656..a78c4db 100644 --- a/Classes/Frontend/RssFeed/SitemapDataProvider.php +++ b/Classes/Frontend/RssFeed/SitemapDataProvider.php @@ -42,7 +42,7 @@ class SitemapDataProvider extends RecordsXmlSitemapDataProvider array $config = [], ContentObjectRenderer $cObj = null ) { - $categoryUid = intval($request->getQueryParams()['category'] ?? 0); + $categoryUid = intval($request->getQueryParams()['category_id'] ?? 0); if ($categoryUid > 0) { $pageUids = $this->getPageUidsWithRelationToCategory($categoryUid); $config['additionalWhere'] = ($config['additionalWhere'] ?? '') diff --git a/Configuration/TypoScript/Setup/RssFeed.typoscript b/Configuration/TypoScript/Setup/RssFeed.typoscript index f292274..d91c7cd 100644 --- a/Configuration/TypoScript/Setup/RssFeed.typoscript +++ b/Configuration/TypoScript/Setup/RssFeed.typoscript @@ -59,7 +59,7 @@ page { 10 = TEXT 10.value = &type=1533906435&sitemap=blog-posts 11 = TEXT - 11.value = &category= + 11.value = &category_id= 12 = TEXT // uid is casted to int within PHP source 12.data.dataWrap = DB : sys_category:{GP:topic_id}:uid @@ -77,10 +77,10 @@ seo_sitemap { userFunc { variables { categoryId = TEXT - categoryId.data = GP:category + categoryId.data = GP:category_id categoryId.intval = 1 categoryTitle = TEXT - categoryTitle.data.dataWrap = DB : sys_category:{GP:category}:title + categoryTitle.data.dataWrap = DB : sys_category:{GP:category_id}:title } } } diff --git a/Resources/Private/Templates/Sitemaps/RssFeed.xml b/Resources/Private/Templates/Sitemaps/RssFeed.xml index ada3c2f..d384255 100644 --- a/Resources/Private/Templates/Sitemaps/RssFeed.xml +++ b/Resources/Private/Templates/Sitemaps/RssFeed.xml @@ -6,7 +6,7 @@ Daniel Siepmann - Coding is Art - Blog Posts {settings.categoryTitle} List of {settings.categoryTitle} blog posts at daniel-siepmann.de {f:uri.page(pageUid: 11, additionalParams: {topic_id: settings.categoryId}, absolute: 1)} - + Daniel Siepmann - Coding is Art - All Blog Posts