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.
This commit is contained in:
Daniel Siepmann 2021-09-03 07:27:54 +02:00
parent d8a9608cec
commit 5358b7f914
3 changed files with 5 additions and 5 deletions

View file

@ -42,7 +42,7 @@ class SitemapDataProvider extends RecordsXmlSitemapDataProvider
array $config = [], array $config = [],
ContentObjectRenderer $cObj = null ContentObjectRenderer $cObj = null
) { ) {
$categoryUid = intval($request->getQueryParams()['category'] ?? 0); $categoryUid = intval($request->getQueryParams()['category_id'] ?? 0);
if ($categoryUid > 0) { if ($categoryUid > 0) {
$pageUids = $this->getPageUidsWithRelationToCategory($categoryUid); $pageUids = $this->getPageUidsWithRelationToCategory($categoryUid);
$config['additionalWhere'] = ($config['additionalWhere'] ?? '') $config['additionalWhere'] = ($config['additionalWhere'] ?? '')

View file

@ -59,7 +59,7 @@ page {
10 = TEXT 10 = TEXT
10.value = &type=1533906435&sitemap=blog-posts 10.value = &type=1533906435&sitemap=blog-posts
11 = TEXT 11 = TEXT
11.value = &category= 11.value = &category_id=
12 = TEXT 12 = TEXT
// uid is casted to int within PHP source // uid is casted to int within PHP source
12.data.dataWrap = DB : sys_category:{GP:topic_id}:uid 12.data.dataWrap = DB : sys_category:{GP:topic_id}:uid
@ -77,10 +77,10 @@ seo_sitemap {
userFunc { userFunc {
variables { variables {
categoryId = TEXT categoryId = TEXT
categoryId.data = GP:category categoryId.data = GP:category_id
categoryId.intval = 1 categoryId.intval = 1
categoryTitle = TEXT categoryTitle = TEXT
categoryTitle.data.dataWrap = DB : sys_category:{GP:category}:title categoryTitle.data.dataWrap = DB : sys_category:{GP:category_id}:title
} }
} }
} }

View file

@ -6,7 +6,7 @@
<title>Daniel Siepmann - Coding is Art - Blog Posts {settings.categoryTitle}</title> <title>Daniel Siepmann - Coding is Art - Blog Posts {settings.categoryTitle}</title>
<description>List of {settings.categoryTitle} blog posts at daniel-siepmann.de</description> <description>List of {settings.categoryTitle} blog posts at daniel-siepmann.de</description>
<link>{f:uri.page(pageUid: 11, additionalParams: {topic_id: settings.categoryId}, absolute: 1)}</link> <link>{f:uri.page(pageUid: 11, additionalParams: {topic_id: settings.categoryId}, absolute: 1)}</link>
<atom:link href="{f:uri.page(pageUid: 1. pageType: 1533906435, additionalParams: {sitemap: 'blog-posts', category: settings.categoryId}, absolute: 1)}" rel="self" type="application/rss+xml" /> <atom:link href="{f:uri.page(pageUid: 1. pageType: 1533906435, additionalParams: {sitemap: 'blog-posts', category_id: settings.categoryId}, absolute: 1)}" rel="self" type="application/rss+xml" />
</f:then> </f:then>
<f:else> <f:else>
<title>Daniel Siepmann - Coding is Art - All Blog Posts</title> <title>Daniel Siepmann - Coding is Art - All Blog Posts</title>